Effective Python 2nd 이펙티브 파이썬 : 파이썬 코딩의 기술의 BETTER WAY(6,7,8) 요약본입니다.
item = ('파전', '막걸리')
first, second = item
def bubblesort(a):
for idx in range(len(a)-1) :
for i in range(len(a) - 1 - idx):
if a[i] < a[i+1] :
a[i], a[i+1] = a[i+1], a[i]
foods = [('신라면',350), ('마카롱',800), ('하와이안 피자', 0)]
for rank, (name, calories) in enumerate(foods, 1):
print(f'#{rank}: {name}은 {calories} 칼로리입니다.'
names = ['이지은', '이승윤', '공유']
counts = [len(a) for a in names]
for name, count in zip(names, counts):
if count > max_count:
longest_name = name
max_count = count