Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hangi ad mlarla z l r ? My pyhton file.py while True: print ( Enter + for summation ) print ( Enter -

hangi admlarla zlr?
My pyhton
file.py
while True:
print ("Enter + for summation")
print ("Enter - fou subtraction")
print("Enter * for multiplication")
print ("Enter / for division")
print ("Enter x to exit")
choice = input ("Enter your operation choice: ").strip()
if choice. lower()==|x'| :
break
if choice in {'+?',?'-1,3**1,11} :
txy :
numberl = float (input ("Enter the first number: "))
number2= float (input ("Enter the second number: "))
except ValueError:
print ("Invalid input. Please enter valid numbers.")
continue
if choice ==?'+?' :
result = number 1+ number 2
elif choice ==
result = number 1- number 2
elif choice ==
result = number 1* number 2
elif choice == T/ :
if number2,0 :
result = number 1? number2
else:
print ("Ehron: Camoty dityde by zero. ")
continue
print (f"Result: {result}")
else :
print("Invalid operation. Flease enter a valid operation. ")
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions