top of page

Use of variable data type in Data Analytics Course

Updated: May 3


Each type of tool has a specific purpose: a hammer for driving nails into wood, a screwdriver for applying paint, and a wrench for tightening or loosening nuts and bolts. In this article we will tell you the use of variable data type in data analytics course.


The same goes for the variables we use to hold data in our code. No matter what programming language you use, when you're building a website or app, you want to use the right type of variable for a specific purpose. We'll look at basic types and complex types, such as definitions (arrays) and objects.

You can also watch the relevant video that will guide you through the most important information.


Fundamental Types


Fundamental types found in many programming languages ​​include:

numeric: We use this for any data that is numeric or involves adding numbers or other mathematical operations.


Some programming languages ​​have more than one type of numeric data, depending on whether the number is, for example, an integer, a decimal number, or a currency unit.


If we were playing a guessing game, we would include the guessed number in the data format like this:

userGuess = 4


string: We use this for all text. For example, name, address or message. In most programming languages, strings need expressions. Please note that the text before words may contain spaces and other special characters.


Date: We use this for information that has a date or time, such as a birthday. Users

Days = April 14, 2001


Boolean: We only use this for data that is valid or false. In a guessing game, what the user uses is true or false. There is no other value.


rightGuess = true


For programming languages ​​that are considered "highly typed," such as C# and TypeScript, the data type defines the type of data that can be assigned to that variable. If you try, you will get an error because you put the wrong data type in variable . With languages ​​"In "hard-coded" languages ​​like JavaScript and Python, the data type defines the data type assigned to it. If you do this the type can change, put different data types in this variable. So the type changes based on the value assigned to it.




Array Data Type


Another important data type in programming is arrays, called arrays in some programming languages. Suppose we add a feature to a website or application that allows the user to name each feature. We can take each name in several variations, as shown in Figure 1. However, we now need to limit the number of animals we can allow based on the variables we have defined.


Use of variable data type
Use of variable data type


lines solves this problem. A collection is a collection or list of objects. You can think of an array as a list of objects.

Data Since the data in an array is usually of the same type, you can have an array of numbers, strings, or dates.

In some programming languages, including C#TypeScript, JavaScript, and Python, arrays are defined with square brackets: and each value in the array is separated by a comma.



We are defining a string here. Note that the lines must be enclosed within the given lines.

Object data types (custom data types)


What about object data in our applications? Figure 3 shows something like this:

Pet

Customer

Product

Or SMS, I actually mean social media here, but they're close enough.



0 views0 comments

Comments


bottom of page