Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. # Given three numbers, represented by three variables, write a piece of code which displays the maximum
  2. # of them, at stdout. Use only if/else/elif and print statements.
  3.  
  4. a = 1
  5. b = 2
  6. c = 3
  7.  
  8. if a > b:
  9. if a > c:
  10. print(f"a={a} max")
  11. elif a > c:
  12. if a > b:
  13. print(f"a={a} max")
  14. elif b > a:
  15. if b > c:
  16. print(f"b={b} max")
  17. elif b > c:
  18. if b > a:
  19. print(f"b={b} max")
  20. else:
  21. print(f"c={c} max")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement