fork download
  1. x=6
  2. y=7
  3. print("Arithmetic Operator")
  4. print("x+y",x+y)
  5. print("x-y",x-y)
  6. print("x*y",x*y)
  7. print("x/y",x/y)
  8. print("x%y",x%y)
  9. print("x**y",x**y)
  10. print("x//y",x//y)
  11.  
  12. x=7
  13. y=8
  14. print("Comparison Operator")
  15. print("x==y",x==y)
  16. print("x!=y",x!=y)
  17. print("x<y",x<y)
  18. print("x>y",x>y)
  19. print("x<=y",x<=y)
  20. print("x>=y",x>=y)
  21.  
  22. p=15
  23. q=14
  24. print("Logical Operator")
  25. print("p and q",p and q)
  26. print("p or q",p or q)
  27. print("not q",not q)
  28.  
  29. x=9
  30. y=8
  31. print("Assignment Operator")
  32. x+=y
  33. print("x=",x)
  34. x-+y
  35. print("x=",x)
  36. x*=y
  37. print("x=",x)
  38. x/=y
  39. print("x=",x)
  40. x%=y
  41. print("x=",x)
  42. x//=y
  43. print("x=",x)
  44.  
  45. fruits=["Mango","Orange","Apple"]
  46. print("Membership operator")
  47. print("apple in fruits",'Apple'in fruits)
  48. print("grapes not in fruits",'Grapes'not in fruits)
  49.  
  50. x=10
  51. y=10
  52. z=5
  53. print("Identity operator")
  54. print("x is y",x is y)
  55. print("x is not z",x is not z)
  56.  
  57.  
Success #stdin #stdout 0.02s 7304KB
stdin
Standard input is empty
stdout
Arithmetic Operator
('x+y', 13)
('x-y', -1)
('x*y', 42)
('x/y', 0)
('x%y', 6)
('x**y', 279936)
('x//y', 0)
Comparison Operator
('x==y', False)
('x!=y', True)
('x<y', True)
('x>y', False)
('x<=y', True)
('x>=y', False)
Logical Operator
('p and q', 14)
('p or q', 15)
('not q', False)
Assignment Operator
('x=', 17)
('x=', 17)
('x=', 136)
('x=', 17)
('x=', 1)
('x=', 0)
Membership operator
('apple in fruits', True)
('grapes not in fruits', True)
Identity operator
('x is y', True)
('x is not z', True)