Advertisement
Toma252

3.2

Oct 17th, 2019
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. # This program provides remainder when dividing any whole number with 10#
  2. #########################################################################
  3.  
  4. # Generate random number
  5. import random
  6.  
  7. x = random.randint(-999999999, 999999999)
  8.  
  9. # Divide user's entry by 10
  10. # Using // to get whole number
  11. Y = x // 10
  12.  
  13. # Calculating remainder
  14. Z = (x - (Y * 10))
  15.  
  16. # Print the result
  17. print("The remainder when you divide %d with 10 is %d." % (x, Z))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement