Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am having trouble running Scientific Calculator in python. If i press option 7 with no operations prior it prints correctly. But if I press
I am having trouble running Scientific Calculator in python. If i press option 7 with no operations prior it prints correctly. But if I press option 7 and then option 0 as the next operation, it prints the first statement for 7 but after when i enter 0 as the next operation, instead of exiting the program it prints the menu again.
File Edit View Navigate Code Refactor Run Tools VCS Window Help python Project 1sci_calculator.py Bookmarks Structure python Project 1 C:\Users\( 1 venv library root 2 Lib 3 Run: > Scripts site-packages calculator.py .gitignore pyvenv.cfg blackjack.py calculator.py p1 9 numeric_conversion.py 10 11 12 13 14 15 IIIII Binary Skeletons 17 > DLLs > IIIII Extended Definition: 18 > Lib 19 > p1_random.py random.py sci_calculator.py IIII External Libraries > site-packages calculator.py > Scripts .gitignore pyvenv.cfg > IIIII Typeshed Stubs Scratches and Consoles calculator X FIUCCus 4 5 O Search 6 Version Control Run 7 Python311 library rc 20 I site-packages 21 venv library root 22 Lib 23 24 25 26 27 28 29 A while exit_calculator == False sci_calculator.py numeric_conversion.py X import math #log function exit_calculator = False calculation = 0 #Sum of calculations total_ops = 0 #Number of operations performed operation = 1 current_result = 0 #Result of operation print("Current Result: 0.0") A while exit_calculator == False: print("Calculator Menu") # Operations to prefprm print("- print("0. Exit Program") print("1. Addition") print("2. Subtraction") print("3. Multiplication") print("4. Division") print("5. Exponentiation") print("6. Logarithm") print("7. Display Average") Python Packages operation = int(input("Enter Menu Selection: ")) # This prompts the user to enter the operation first_operand = 0 # This prompts the user to enter the first number for the equation second_operand = 0 # This prompts the user to enter a second number for the equation break sci_calculator FOCU WILII CALL Couc O pythonProject1 - blackjack.py if operation == 0: #Exits caculator print("Thanks for using this calculator. Goodbye!") blackjack.py X elif operation == 1: #Addition blackjack X TODO Python Console D p1_random.py X Problems 6 Terminal Services Current File A 40 2 ^ 8:32 CRLF UTF-8 4 spaces Python 3.11 (pythonProject1) 59F Cloudy ^ 10:50 AM x Notifications
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started