Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##init var
- ##Calc by Anzo, it's shitty just training ty.
- inp=0
- ust=0
- a=1
- b=1
- opt=["sum","substraction","multiplication","division"]
- rst=[a+b,a-b,a*b,a/b]
- r2t=["+","-","x","/"]
- ##Importing os for cls
- import os
- def cls():
- os.system('cls')
- cls()
- #OptionSelect
- while True:
- cls()
- print("What options do you choose/nPress Enter to select, type 'C' to confirm")
- print(">>",opt[ust],"<<")
- ##debug
- print(ust)
- inp=input("")
- if inp=="C":break
- elif inp!="":continue
- if not ust>2:
- ust=ust+1
- else:ust=0
- #Garbage code
- #print("you chose "+str(opt[ust])+".")
- #input("Press Enter to continue")
- ##Calc
- while True:
- cls()
- print("Input first number to calculate")
- try:
- a=int(input())
- except ValueError:continue
- break
- ##Calcstep2
- while True:
- cls()
- print("Input second number to calculate")
- try:
- b=int(input(str(a)+r2t[ust]))
- except ValueError:continue
- break
- #Result
- while True:
- rst=[a+b,a-b,a*b,a/b]
- cls()
- print("the result of the "+str(opt[ust])+" is:")
- print(str(a)+str(r2t[ust])+str(b)+"="+str(rst[ust]))
- print("Press Enter to exit")
- input()
- break
- #Bye
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement