Module % help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Module % help

We need to distribute math & history textbooks to students. There are two class section: the 1st class has 18 students; the 2nd section 19 students. The total number of books avalaibles for distribution is 76 write a program to calculate and produce how many books will be left after each student receive both books. I had a problem i write print ( 76 % (19+18)) and its wrong ..help me please .

9th Mar 2021, 9:52 PM
Yunuen Sarasuadi Acosta Meza
Yunuen Sarasuadi Acosta Meza - avatar
3 Answers
+ 3
a=76%2 b=a+(2*(18+19)) c=76-b print(c)
21st Jul 2021, 7:01 PM
Peyman Daei Rezaei
Peyman Daei Rezaei - avatar
+ 2
need_book = ((group1 * 2) + (group2 * 2)) remains_book = books % need_book
10th Mar 2021, 12:09 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
each student receives "both books", so it should be 76%((19+18)*2)
9th Mar 2021, 9:59 PM
Abhay
Abhay - avatar