Advertisement
johnpentyrch

math24

Feb 19th, 2022
933
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. coins=int(input('How many £1 coins are there to share '))
  2. people=int(input('How many people to share with '))
  3. coinseach=coins//people
  4. coinsleft=coins % people
  5. if (coinseach!= 0):
  6.     print('There are ',coinseach,' £1 coins each\n')
  7. else:
  8.     print('There are not enough £1 coins to share evenly ')
  9. if (coinsleft ==0):
  10.     print('There are no coins left over')
  11. else:
  12.     print('There are ',coinsleft,' coins left over')
  13.     pence=coinsleft*100
  14.     print('If you converted the left over pound coins to pence you would have', pence, ' pence')
  15.     if (pence >= people):
  16.         penceeach=pence//people
  17.         penceleft=pence%people
  18.         print('You could give everybody ',penceeach,' and have ',penceleft,' pence left')
  19.     else:
  20.         print('but there are not enough pence to distribute')
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement