Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("This program can be used to add and subtract")
- x=int(input("x:"))
- y=int(input("y:"))
- print("Choose for addition :1 or subtraction 0")
- z = int(input("z:"))
- if z==1:
- print("Addition selected.")
- a= x+y
- print("The sum of ",y,"and",x,"is",a)
- elif z ==0:
- print("Subtraction selected.")
- a= x-y
- print("The difference between ",y,"and",x,"is",a)
- else:
- print("Kindly input either 1 or 0")
Add Comment
Please, Sign In to add comment