Текущий код:
Код: Выделить всё
if c[i] == 'fine':
a[i] += 3
elif c[i] == 'check':
a[i] += 1
else:
a[i] += 0
Код: Выделить всё
a[i] += 3 if c[i] == 'fine' else (a[i] += 1 if c[i] == 'check' else a[i] += 0)
Подробнее здесь: https://stackoverflow.com/questions/793 ... -in-python
Мобильная версия