Python variables

Python variable types include Numbers, String,List, Tuples and Dictionary.

To test the type of a variable, use type() method:

>>> x = 3
>>> type(x)
<class 'int'>
>>> x = "abc"
>>> type(x)
<class 'str'>


















endmemo.com © 2024  | Terms of Use | Privacy | Home