I am having trouble running Scientific Calculator in python. If i press option 7 with no operations
Fantastic news! We've Found the answer you've been seeking!
Question:
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.
Transcribed Image Text:
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 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
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Write a method: that displays the prompt string, reads an integer, and tests whether it is between the minimum and maxi mum. If not, print an error message and repeat reading the input. Add the...
-
Discuss in detail the notion of competitive advantage. Is it possible to achieve a sustainable competitive advantage, or is a sustainable competitive advantage just a theory? Do Apple's iPad, TiVo,...
-
Silverado Inc. buys titanium from a supplier that requires a six-month firm commitment on all purchases. On January 1, 20X1, Silverado signs a contract with the supplier to purchase 10,000 pounds of...
-
Use Table 1.1 to find the three most open economies in 2009, and the three most closed. How does the growth performance of these countries compare with the growth of the average country in the table?...
-
Levon Helm was a kind of one-man mortgage broker. He would drive around Tennessee looking for homes that had second mortgages, and if the criteria were favorable, he would offer to buy the second...
-
mass of water = 26.11g Volume of head block is = 1.17 of a Hond 4 STROKE engine , Calculate the compression ratio of this engine, using the measurements
-
1. As Jamie Lee and Ross review their assets, can you tell them which will be valuable to them for income as retirement approaches? 2. Jamie Lee and Ross estimate that they will have one million...
-
1. The unrealized gain (loss) from the change in fair value of investment properties for 2020 is 2. The balance of investment property at December 31, 2020 is 3. Assuming the company is using the...
-
If the decedent is a Filipino citizen, his gross estate is: Based on the preceding number, the deductible family home is: If the decedent is a non-resident alien and his country does not impose...
-
Vadim bought his wife a "gold" bracelet from a guy on the street for $120. If he drops it in a beaker of water and the volume raises 450 cm 3 and the mass is determined to be 0.9 kg, then is the...
-
It is May. A corporate comptroller expects to have approximately $ 5 0 0 , 0 0 0 cash available in a few months and intends to invest the money in Treasury bonds. The current price of the issue that...
-
There are three cases: ( a ) $ 2 , 0 0 0 annually, 9 years, 4 % ; ( b ) $ 1 , 0 0 0 annually, 2 3 years, 9 % ; ( c ) $ 8 , 0 0 0 annually, 4 0 years, 8 % . Calculate the future value of a lump sum...
-
Susan from marketing is working on the launch strategy of a new product line. Susan is strongly advocating for spending a big part of the budget on TV advertisement to boost this product's sales, as...
-
Which action involves normalizing acceptance of the project deliverables and during this phase the key project stakeholders, such as the customer and sponsor for the project, inspect and then...
-
Grace is training to be an airplane pilot and must complete five days of flying training in October with at least one day of rest between trainings. How many ways can Grace schedule her flying...
-
You created an application named QuartsToGallonsInteractive that accepts a number of quarts from a user and converts the value to gallons. Now, add exception-handling capabilities to this program and...
-
Write a program that declares two LocalDate objects and assign values that represent January 31 and December 31 in the current year. Display output that demonstrates the dates displayed when one,...
-
What is the value of each of the following Boolean expressions? a. 15 < 13 b. 8 < = (2 + 6) c. 15 == 15 d. 3 >= 3 e. 4 * 2 == 2 * 4 f. 5 < 8 3 g. 7 != 7 h. 8 != (2 + 5) i. 10 20 == 10 j. 3 + 2 * 6...
-
A reversible heat engine operates between two reservoirs at temperatures of \(600^{\circ} \mathrm{C}\) and \(40^{\circ} \mathrm{C}\). The engine drives a reversible refrigerator which operates...
-
A domestic food freezer maintains a temperature of \(-15^{\circ} \mathrm{C}\). The ambient air temperature is \(30^{\circ} \mathrm{C}\). If heat leaks into the freezer at the continuous rate of...
-
2 kg of water at \(80^{\circ} \mathrm{C}\) is mixed adiabatically with \(3 \mathrm{~kg}\) of water at \(30^{\circ} \mathrm{C}\) in a constant pressure process of 1 atmosphere. Find the increase in...
Study smarter with the SolutionInn App