Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Jaką operację chcesz wykonać? Dostępne : dodawanie, odejmowanie, mnożenie, dzielenie")
- print("UWAGA! Przy odejmowaniu odejmowana jest druga liczba będąca jednocześnie mianownikiem w dzieleniu")
- while True:
- wybor = input()
- if wybor == "dodawanie":
- liczba1 = int(input("Podaj pierwszą liczbe: "))
- liczba2 = int(input("Podaj drugą liczbe: "))
- print(liczba1 + liczba2)
- if wybor == "odejmowanie":
- liczba1 = int(input("Podaj pierwszą liczbe: "))
- liczba2 = int(input("Podaj drugą liczbe: "))
- print(liczba1 - liczba2)
- if wybor == "mnożenie":
- liczba1 = int(input("Podaj pierwszą liczbe: "))
- liczba2 = int(input("Podaj drugą liczbe: "))
- print(liczba1 * liczba2)
- if wybor == "dzielenie":
- liczba1 = int(input("Podaj pierwszą liczbe: "))
- liczba2 = int(input("Podaj drugą liczbe: "))
- if liczba2 == 0:
- print("Nie można dzielić przez zero")
- else:
- print(liczba1 / liczba2)
- if wybor == "kopytko":
- print("Koniec pracy")
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement