Skip to main content

#Assignment Operators

 #Assignment Operators



  1. a = 31
  2. c = 9

  3. #Add AND
  4. c += a # c = c + a; 9 + 31 = 40
  5. print ("the addition is :",c)

  6. #Subtract AND
  7. c -= a # c = c - a; 40 - 31 = 9
  8. print ("the substraction is :",c)

  9. #Multiply AND
  10. c *= a # c = c * a; 9 * 31 = 279
  11. print ("the multiply is :",c)

  12. #Division AND
  13. c /= a # c = c /a; 279/31 = 9.0
  14. print ("the division is :",c)

  15. #Mod AND
  16. c %= a # c = c % a; 9.0 % 31  = 9.0
  17. print ("the modulos is :",c)


#Execute


#Output

#the addition is : 40

#the substraction is : 9

#the multiply is : 279

#the division is : 9.0

#the modulos is : 9.0






                                                      #ThE ProFessoR