Variables in Python

Variables , can be considered as cups , which can had different things , it may be water , juice , or rather anything you like.

To be more technical , a variable is a name that may be bound to a value , and need not remain the same.

They can be numerical , char , strings , combination of them , interestingly Python also supports complex numbers ! {P+iJ}

Examples :

Numericals :

myNum = 7

print myNum , would output "7" on the terminal .

You also assign multiple variables like :

myNum = urNum = hisNum = 7


Characters :

alpha = a
beta = b

Stings :

myName = "hemanth"
myName = 'hemanth'
myName = "'hemanth"'

{Yes it can be single , double and even triple quoted !!}


Share this