range 심화
[10, 2, 30, 4, 50, 6, 70, 8, 90, 10, 110, 12, 130, 14, 150, 16, 170, 18, 190, 20] [10, 2, 30, 4, 50, 6, 70, 8, 90, 10, 110, 12, 130, 14, 150, 16, 170, 18, 190, 20] li=[]for i in range(1,21): if i%2==0: li.append(i) else: i=i*10 li.append(i)print(li)x=[x *10 if x %2 !=0 else x for x in range(1,21)]print(x) print([[j for j in range(5)]for i in range(5)]) [[0, 1, 2,..
카테고리 없음
2024. 7. 4. 19:48