Guest User

Untitled

a guest
Feb 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. print("This program can be used to add and subtract")
  2. x=int(input("x:"))
  3. y=int(input("y:"))
  4. print("Choose for addition :1 or subtraction 0")
  5. z = int(input("z:"))
  6.  
  7. if z==1:
  8. print("Addition selected.")
  9. a= x+y
  10. print("The sum of ",y,"and",x,"is",a)
  11. elif z ==0:
  12. print("Subtraction selected.")
  13. a= x-y
  14. print("The difference between ",y,"and",x,"is",a)
  15. else:
  16. print("Kindly input either 1 or 0")
Add Comment
Please, Sign In to add comment