Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- opp = 0
- def start():
- print("Welcome to the Calculator!")
- while calculate():
- pass
- result()
- def calculate():
- print("Enter which function you would like to use.")
- theta = raw_input("Enter angle theta: ")
- hyp = raw_input("Enter hypotenuse: ")
- theta = float(theta)
- theta = math.radians(theta)
- hyp = float(hyp)
- opp = math.sin(theta) * hyp
- return opp
- def result():
- print(opp)
- def calculateAgain():
- answer = raw_input("Would you like to calculate something again? y/n: ")
- if answer in ("y", "Y", "yes", "Yes"):
- return answer
- elif answer in ("n", "N", "no", "No"):
- print("Thank you for using the Calculator!")
- if __name__ == '__main__':
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement