Variables of Python

Kinds of Variables

scalar and non-scalar both object

scalar

  • int : integer
  • float : real number
  • bool : True or False
  • none : Null

non-scalar

  • String : data values that are made up of ordered sequences of characters, such as “hello world”

checking data type

print(type(Variable))

Case-Sensitive

a and A are different variable

Casting

x = str(3)    # "4"
y = int(3)    # 4
z = float(3) # 4.0

 Share!

 
comments powered by Disqus