This exercise expands on the calculator, which was made in chapter 4, exercise 4. In…
Jump to turn (6)
- 1This exercise expands on the calculator, which was made in chapter 4, exercise 4
- 2Incorrect output: your program printed "1.0", but should have printed "2" Expect
- 3does brass tarnish protect itself
- 4Incorrect output: your program printed "1.0", but should have printed "2" Expect
- 5import math def calculator(): num1 = float(input("Give the first number: ")) num
- 6Incorrect output: your program printed "QuitPlease", but should have printed "(8
- User
This exercise expands on the calculator, which was made in chapter 4, exercise 4. In this exercise, add sin() and cos() -calculations from the library module math to the calculator. Add these actions as selections 5 and 6, simultaneously moving the "change numbers" feature to 7 and "Quit" to 8. When the user calls either of the new features, the first number is the divident and second the divider like this: sin(number_1/number2). When correctly implemented, the program prints the following: