Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def exit():
- return
- def pole_kwadratu(a):
- print("pole: ", a * a)
- menu()
- def pole_prostokata(a,b):
- print("pole: ", a * b)
- menu()
- def pole_kola(r):
- print("pole: ", math.pi * r ** 2)
- menu()
- def menu():
- wybor = int(input("0 - koniec programu || 1 - pole kwadratu || 2 - pole prostokata || 3 - pole kola. Co wybierasz: "))
- if wybor == 0:
- exit()
- elif wybor == 1:
- a = int(input("podaj a: "))
- pole_kwadratu(a)
- elif wybor == 2:
- a = int(input("podaj a: "))
- b = int(input("podaj b: "))
- pole_prostokata(a,b)
- elif wybor == 3:
- r = int(input("podaj r: "))
- pole_kola(r)
- else:
- print("nie ma takiego numeru")
- menu()
- menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement