Advertisement
endzie_fyrge

[21] Quotient or Remainder

Jul 10th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. a = int(input("Enter a number: "))
  2. b = int(input("Enter another number: "))
  3. k = input("Choose quotient or remainder: ")
  4.  
  5. if k.upper() == "QUOTIENT":
  6.     c = a * b
  7.     print(f"The quotient is {c}.")
  8. elif k.upper() == "REMAINDER":
  9.     c = a % b
  10.     print(f"The remainder is {c}.")
  11. else:
  12.     print("Error: You didn't choose between quotient or remainder.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement