What is data-type?
Types of data. It is data attribute which tall the compiler or interpreter who the programmer intends to use the data. There are lot of data attribute now i will tall you some basic data-types which we use primary level. below i show some python examples of datatype
- String
- String. String can combine some character together and make a word or sentence. below i will show you an examples with text and image
- a = 'Hallow'
- Note Here I can use 'signal at' we can use "double at" that does not matter of string.
- Integer
- Integer is numerical value whiteout any fraction number like 10, 65, 78, 65 all of the numbers are integer. Below i will show you an examples with an image.
- Float
- Float is numerical value with fraction number like 10.00, 3.1416, 5.50, 2.25, 20.75 all of the numbers are float. Below i will show you an examples with an image.
- Note look here 10 and 10.00 same number but data type is defrauder because here i used 10.00 (dot) so it float number.
- Character
- Character. It is a single character like A, a, b, C, d, D
- Note Python has chr data-type but it automatically detect string. don't worry. If we need Character type, data-type. we have to create manually below i show you how we can create character type data-type?
- First we have to declare a = chr(a)
- List / Array
- Look here we use python so. always we call List not array. List. List can combine "String", integer, float, character. All of the data-type we can use into the list. N......... number of value we can attach into the list too. I show you an example in image.
- Note: We can create ND list like 3D, 5D, 1000D.
- Tuple
- Tuple. tuple one kind of list but different is we does not change any value inside the tuple. we change value inside list. It is different between tuple and list.