+ 1
Can you help please
There are 2 class sections: the first section has 18 pupils, and the second one has 19. The total number of books available for distribution is 76. Write a program to calculate and output how many books will be left after each student receives both books. With % operator . I know the answer but miss the why and how
6 Respostas
+ 1
rest=76%(2*(18+19))
+ 1
Next time please show or better provide link to your attempt on SL Playground.
Happy coding.
0
Thank you
0
Do you mean each student get two book by "after each student recieves both book".
0
Yes
0
Here one more example >>>
total_book = 76
student = 37 # 18 + 19
left_book = 76 % (37*2)
print(left_book)