강의

멘토링

커뮤니티

Inflearn Community Q&A

gganbu's profile image
gganbu

asked

Python 100 Problem Solving with Examples Part 1

List, loop, element value, reverse

예제로 공부하는 Python 100 문제풀이 Part.1 /리스트, 반복문, 요소 값, 거꾸로

Written on

·

271

0

선생님

굳이 lst[::-1] 몰라도 아래와 같이 코딩해도 비슷한 값이 나와요

lst=['dog','hippo','elephant','lion','tiger','alligator']
a=len(lst)
index=0
print(a)
for i in range(len(lst)):
    a=a-1
    index=index+1
    print(index,'.',lst[a],'',end='')

 

 

리스트반복문python

Answer

This question is waiting for answers
Be the first to answer!
gganbu's profile image
gganbu

asked

Ask a question