What am I doing wrong? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
15th Feb 2021, 4:07 AM
∆BH∆Y
∆BH∆Y - avatar
2 Respuestas
+ 3
∆BH∆Y function should be call inside while loop and it should be add everytime def progress_made(x,y): return x-y depth = int(input()) days = 0 a = 0 while a <= depth: a += progress_made(7,2) days += 1 print(days) But this logic will give wrong output. So try this depth = int(input()) days = 0 a = 0 while True: a += 7 days += 1 if a >= depth: break a -= 2 print(days)
15th Feb 2021, 5:00 AM
A͢J
A͢J - avatar
+ 1
∆BH∆Y Edited my answer. Check again.
15th Feb 2021, 5:08 AM
A͢J
A͢J - avatar