Tuesday 3 January 2017

PYTHON-print & variables

TO PRINT

print("hello world")
hello world

ASSIGNING VALUE TO VARIABLES

  my_int=7
  my_float=7.7
  my_bool=True

PRINTING ASSIGNED VALUES

print(my_int)
print(my_float)
print(my_bool)

NOTE:
value assigned to the boolean variable start with CAPITIAL LETTER (True,False)

REASSIGNING THE VARIABLE VALUES

  my_int=1
  my_float=1.7
  my_bool=False

PRINTING REASSIGNED VALUES

print(my_int)
print(my_float)
print(my_bool)

No comments:

Post a Comment