i = 1 while i < 2: wh = input ("Виберіть дію:(+)сума (-)різниця (*)множення (/)ділення " ) nom1 = float(input("Перше число: ")) nom2 = float(input("Друге число: ")) if wh =="+": vid = nom1 + nom2 print("Сума " + str(vid)) elif wh =="-": vid = nom1 - nom2 print("Різниця " + str(vid)) elif wh =="*": vid = nom1 * nom2 print("Множення " + str(vid)) elif wh =="/": if nom2 == 0: print("на 0 не ділять бл") elif nom2 != 0: vid = nom1 / nom2 print("Ділення " + str(vid)) else: print('Ти долб**об закрий цей "калькулятор" і убийся')
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question