'edelzwicker', 'gewurztraminer']! plats = ['choucroute', 'munster', 'kouglof'] n = min(len(vins), len(plats))! for i in range(n):! print vins[i], '-->', plats[i]
'edelzwicker', 'gewurztraminer']! plats = ['choucroute', 'munster', 'kouglof'] n = min(len(vins), len(plats))! for i in range(n):! print vins[i], '-->', plats[i] for name, plat in zip(vins, plats):! print name, '-->', plat
'edelzwicker', 'gewurztraminer']! plats = ['choucroute', 'munster', 'kouglof'] n = min(len(vins), len(plats))! for i in range(n):! print vins[i], '-->', plats[i] for name, plat in zip(vins, plats):! print name, '-->', plat for name, plat in izip(vins, plats):! print name, '-->', plat
'edelzwicker', 'gewurztraminer']! plats = ['choucroute', 'munster', 'kouglof'] n = min(len(vins), len(plats))! for i in range(n):! print vins[i], '-->', plats[i] for name, plat in zip(vins, plats):! print name, '-->', plat for name, plat in izip(vins, plats):! print name, '-->', plat from itertools import izip
'munster', 'choucroute'] d = {}! for plat in plats:! if plat not in d:! d[plat] = 0! d[plat] += 1! {'kouglof': 1, 'munster': 2, 'choucroute': 3} d = defaultdict(int)! for plat in plats:! d[plat] += 1