enumerate 사용법
i=["Rad","Green","Black","Blue","Orange","Purple"]#1o2=dict(zip(range(len(i)),i))print(o2)#2o1=dict(enumerate(i))print(o1)#3 o3 =dict(enumerate(i,start=100))print(o3) {0: 'Rad', 1: 'Green', 2: 'Black', 3: 'Blue', 4: 'Orange', 5: 'Purple'} {0: 'Rad', 1: 'Green', 2: 'Black', 3: 'Blue', 4: 'Orange', 5: 'Purple'} 82102@LAPTOP-Q74SBCUO MINGW64 ~/Desktop/python_basic_1.5 $ C:/Users/82102/AppData/Loca..
카테고리 없음
2024. 7. 8. 22:39