Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. import math
  2.  
  3. def exit():
  4. return
  5.  
  6. def pole_kwadratu(a):
  7. print("pole: ", a * a)
  8. menu()
  9.  
  10. def pole_prostokata(a,b):
  11. print("pole: ", a * b)
  12. menu()
  13.  
  14. def pole_kola(r):
  15. print("pole: ", math.pi * r ** 2)
  16. menu()
  17.  
  18. def menu():
  19. wybor = int(input("0 - koniec programu || 1 - pole kwadratu || 2 - pole prostokata || 3 - pole kola. Co wybierasz: "))
  20.  
  21. if wybor == 0:
  22. exit()
  23.  
  24. elif wybor == 1:
  25. a = int(input("podaj a: "))
  26. pole_kwadratu(a)
  27.  
  28. elif wybor == 2:
  29. a = int(input("podaj a: "))
  30. b = int(input("podaj b: "))
  31. pole_prostokata(a,b)
  32.  
  33. elif wybor == 3:
  34. r = int(input("podaj r: "))
  35. pole_kola(r)
  36.  
  37. else:
  38. print("nie ma takiego numeru")
  39. menu()
  40.  
  41. menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement