¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
What am I doing wrong?
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)
+ 1
∆BH∆Y Edited my answer. Check again.