Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculator math.sqrt
#5
print("Select operation.")
print("1.Add")
print("2.Subtract")
print("3.Multiply")
print("4.Divide")
print("5.Square root")
# Take input from the user
choice = input("Enter choice(1/2/3/4/5):")
num1 = int(input("Enter first number: "))
if choice != "5" :
    num2 = int(input("Enter second number: "))
Then add the code to handle square roots after the code for Divide.
Reply


Messages In This Thread
Calculator math.sqrt - by GFreenD - Oct-28-2019, 12:58 PM
RE: Calculator math.sqrt - by ichabod801 - Oct-28-2019, 01:13 PM
RE: Calculator math.sqrt - by GFreenD - Oct-28-2019, 02:08 PM
RE: Calculator math.sqrt - by ichabod801 - Oct-28-2019, 02:20 PM
RE: Calculator math.sqrt - by jefsummers - Oct-28-2019, 08:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding a sqrt function syntax error and <build-in function sqrt> from tkinter import Kael 0 1,882 Oct-14-2019, 05:51 PM
Last Post: Kael

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020