VARIABLES IN PYTHON OR ADVANTAGE OF VARIABLE

 VARIABLES IN PYTHON  :

variable store the value .

SYNTAX : variable_name= value

there are different variables :

  • Numeric variable :  age =21
  • String variable :  name=john
  • Boolean variable : is_true= true
  • List variable : numbers=[1 2 3]
  • tuple variable : coordinates = (10, 20)
  • Set variables : uniqe_numbers={1,2}
  • None variables : empty_value=none


example : 

age=21

print(age)

output :  21








use the print command to output the (number-1)



variable advantages

REUSE : Ones you store the data value in variable you can you whenever you need in program .

Example in below









  • You have to must try in your python compiler use idle avoid online compilers to Errors

Post a Comment

0 Comments