Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Aryan Tomar / DarkTrippin
- # habitica.com/challenges/effd2f51-e4b1-4061-94bb-d91dc7a61f55
- def start():
- print ()
- print ()
- print ()
- print (' Aryan T. / DarkTrippin presents ')
- print (" The solution for Habitica's Programming challenge July 2019 ")
- print (' Python 3 Edition ')
- print (' v0.12 ')
- print ()
- print ('Warning: This is a VERY simple solution for the challenge, very simplified and it is still WIP so no questions please')
- print ()
- print ()
- print ('Please select what type of question you have:')
- print ('1. Division')
- print ('2. Multiplication')
- print ('3. Addition')
- print ('4. Subtraction')
- print ('5. Quit')
- print ()
- print ('Please input the the number of your chosen type')
- qtype = int(input('> '))
- if (qtype >= 1 and qtype <=4):
- print ()
- print ('Please enter the two numbers from your equation SEPERATELY')
- num1 = int (input('> '))
- num2 = int (input('> '))
- if qtype == 1:
- ans = num1/num2
- print ('Answer = ' + str(ans))
- again()
- elif qtype == 2:
- ans = num1*num2
- print ('Answer = ' + str(ans))
- again()
- elif qtype == 3:
- ans = num1+num2
- print ('Answer = ' + str(ans))
- again()
- elif qtype == 4:
- ans = num1-num2
- print ('Answer = ' + str(ans))
- again()
- elif qtype == 5:
- exit()
- else:
- print ('Error: Please input a valid option')
- def again():
- print ()
- print ('Do you wish to calculate again? (yes or no)')
- startAgain = input('> ')
- if startAgain == 'yes' or startAgain == 'y':
- start()
- else:
- startAgain
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement