Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.11 KB | None | 0 0
  1. print("Jaką operację chcesz wykonać? Dostępne : dodawanie, odejmowanie, mnożenie, dzielenie")
  2. print("UWAGA! Przy odejmowaniu odejmowana jest druga liczba będąca jednocześnie mianownikiem w dzieleniu")
  3.  
  4. while True:
  5.     wybor = input()
  6.  
  7.     if wybor == "dodawanie":
  8.         liczba1 = int(input("Podaj pierwszą liczbe: "))
  9.         liczba2 = int(input("Podaj drugą liczbe: "))
  10.         print(liczba1 + liczba2)
  11.     if wybor == "odejmowanie":
  12.         liczba1 = int(input("Podaj pierwszą liczbe: "))
  13.         liczba2 = int(input("Podaj drugą liczbe: "))
  14.         print(liczba1 - liczba2)
  15.     if wybor == "mnożenie":
  16.         liczba1 = int(input("Podaj pierwszą liczbe: "))
  17.         liczba2 = int(input("Podaj drugą liczbe: "))
  18.         print(liczba1 * liczba2)
  19.     if wybor == "dzielenie":
  20.         liczba1 = int(input("Podaj pierwszą liczbe: "))
  21.         liczba2 = int(input("Podaj drugą liczbe: "))
  22.         if liczba2 == 0:
  23.             print("Nie można dzielić przez zero")
  24.         else:
  25.             print(liczba1 / liczba2)
  26.  
  27.     if wybor == "kopytko":
  28.         print("Koniec pracy")
  29.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement