Python break question

Asked 2 years ago, Updated 2 years ago, 20 views

Time=int(input())

pp=[300, 60, 10]

result=[]
count=0


if Time%10==0:
    for i in range(pp):
        count+=Time//pp
        Time=Time%pp

elif Time==0:
    Break # Why is there an error when break comes out here?
    print(count)

python

2022-09-20 10:49

1 Answers

Break works in a loop.

while 1:
    break

for i in range(3):
    break


2022-09-20 10:49

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.