-
Notifications
You must be signed in to change notification settings - Fork 27
Description
During the course on programming in part 1, block 4, in the last task, I found an error, despite the fact that the solution itself is not optimal... but it is also not functional and does not follow the condition of allocating, for example, 21 groups for 100 students and 5 students in a group.
https://tmc.mooc.fi/paste/umPpFP2QFE9ORTk4Doq6dw
ACCEPTED CODE:
Write your solution h
qty = int(input("How many students on the course?"))
desired_group = int(input("Desired group size?"))
if qty / desired_group >= qty // desired_group:
print(f"Number of groups formed: {qty // desired_group + 1}")
if qty // desired_group < desired_group:
print(f"Number of groups formed: {qty // desired_group }")
If you type: students on the course 100
and desired group size 5
Answer will be : 21
So When, Desired group size = Students / desired group size , we have an error printing 21 groups, solution is mistaken and all kind of combinations of that solution changing <= also accepted but are incorrect .
Looking forward for your feedback!
Ystävällisin Terveisin,
Lev K.
lkirillov@icloud.com