강의

멘토링

커뮤니티

Inflearn Community Q&A

201600874811's profile image
201600874811

asked

Introduction to Python for Programming and Data Science

Loop

for 문

Written on

·

230

0

for i in (10,1):

     print(i)

 

이렇게 하면 왜 결과가 아무것도 안 나오나요?

 

bigdatapython

Answer 2

0

201600874811님의 프로필 이미지
201600874811
Questioner

-1 이 없으면 항상 오름차순으로만 가서 10, 9, 8, ..., 1

이렇게 나올 수가 없는 건가요?

0

TeamLab님의 프로필 이미지
TeamLab
Instructor

아래와 같이 해보시기 바랍니다.

for i in range(10, 1, -1):
    print(i)
201600874811's profile image
201600874811

asked

Ask a question