+ 1

What are the variables in python

Hi everyone i am a python newbie and i wana know what are the types of variables with some explination to them . Thanks

20th Nov 2016, 5:14 PM
Adel Alkhaldi
Adel Alkhaldi - avatar
2 RĂ©ponses
+ 4
python is a dynamically typed language, so you don't need to worry about them much. but the base types could be considered these str - string "123" int - integer 123 float - floating point number 1.23 list - list [1, 2, 3] tuple - similar to list but unchangeable (1, 2, 3) set - a set of values, it contains no duplicates {1, 2, 3} dict - a dictionary {key:value} now what could be a little confusing, everything is also an object, there is an 'object' type everything in python is based on. a function is an object too, class is an object, all the above mentioned types are objects.
20th Nov 2016, 5:23 PM
asdadasdsaczxc
0
There is also a 'type' type, to further confuse you. But you really don't need to worry about it until you want to mess with a hierarchy of internal dependencies. I have never done anything with it yet.
20th Nov 2016, 5:42 PM
Amaras A
Amaras A - avatar