파이썬 반복문 유형

  • 103dong103ho
    (103동103호)
  • 103dong103ho's Avatar 이 글의 작성자
  • Offline
  • Newbie
  • Newbie
더보기
26 Jul 2019 13:38 - 26 Jul 2019 13:40 #4780 작성자: 103dong103ho
103dong103ho 님의 글: 파이썬 반복문 유형
1. range 형

for i in range(1, 11):
    print(i)


2. list 형

list1 = ["a", "b", "c", "d"]
for i in list1:
    print(i)


3. tuple 형

tuple1 = ['a', 'b', 'c', 'd']
for t in tuple1:
    print(t)


4. 문자열 형

str1 = "Hello World"
for s in str1:
    print(s)
Time to create page: 0.045 seconds
Powered by Kunena Forum