Files
freeCodeCamp/curriculum/challenges/japanese/07-scientific-computing-with-python/python-for-everybody/iterations-loop-idioms.md
2022-01-20 20:30:18 +01:00

770 B

id, title, challengeType, videoId, bilibiliIds, dashedName
id title challengeType videoId bilibiliIds dashedName
5e7b9f070b6c005b0e76f05e 繰り返し: ループの用法 11 AelGAcoMXbI
aid bvid cid
334491369 BV1tw411R7Mm 376530765
iterations-loop-idioms

--question--

--text--

次のコードでは、値のリストから最小値を見つけようとしています。 1 行にエラーがあり、コードが期待どおりに動作しません。 どの行ですか?

smallest = None
print("Before:", smallest)
for itervar in [3, 41, 12, 9, 74, 15]:
    if smallest is None or itervar < smallest:
        smallest = itervar
        break
    print("Loop:", itervar, smallest)
print("Smallest:", smallest)

--answers--

3


4


6


7

--video-solution--

3