Apr-30-2018, 11:36 PM
Hello. Im having a bit of trouble. Imtrying to get it so the user can input pi, and my program converts it to the math.pi module. However, I want the user to also be able to input integer values and have those print as well. My overall goal is to get the user to be able to type in two numbers and have them add, but i also want them to be able to type something like and pi, and have the program do 5 + 3.14159....
Heres what I got so far...
Heres what I got so far...
import math yes = ["yes", "y", ""] rst = ("yes") while rst in yes: pi = math.pi x = (input("First Value: ")) y = (input("Second Value: ")) x = float(x) y = float(y) print(x + y) rst = str(input("Calculate another number? ")) rst = rst.lower() #removes case sensitivity by making rst all lowercase