fork download
  1. x=7
  2. y=8
  3. print("Arithmetic")
  4. print("X=",x+y)
  5. print("X=",x-y)
  6. print("X=",x/y)
  7. print("X=",x*y)
  8. print("X=",x//y)
  9. print("X=",x**y)
  10. print("X=",x%y)
  11.  
  12. x=8
  13. y=9
  14. print("condition")
  15. print("x=",x==y)
  16. print("x=",x!=y)
  17. print("x=",x>y)
  18. print("x=",x<y)
  19. print("x=",x>=y)
  20. print("x=",x<=y)
  21.  
  22. p=10
  23. q=78
  24. print("Logical")
  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=10
  30. y=12
  31. print("Assignment")
  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=['apple','oranges','greens']
  46. print("ans",'apple'in fruits)
  47. print("ans",'apple'not in fruits)
  48.  
  49. x=10
  50. y=10
  51. z=10
  52. print("ans",x is y)
  53. print("ans",x is not z)
Success #stdin #stdout 0.02s 7308KB
stdin
Standard input is empty
stdout
Arithmetic
('X=', 15)
('X=', -1)
('X=', 0)
('X=', 56)
('X=', 0)
('X=', 5764801)
('X=', 7)
condition
('x=', False)
('x=', True)
('x=', False)
('x=', True)
('x=', False)
('x=', True)
Logical
('p and q', 78)
('p or q', 10)
('not q', False)
Assignment
('x=', 22)
('x=', 10)
('x=', 120)
('x=', 10)
('x=', 10)
('x=', 0)
('ans', True)
('ans', False)
('ans', True)
('ans', False)