-2
필자는 반복해야 할 파이썬 코드 섹션을 두 개만 변경했지만, 단축 할 수있는 방법이 있습니까?파이썬 3.3.3 단축 코드
코드 :
if int(input)==1:
output=10
if int(input)==2:
output=9
모든 방법
if int(input)==88:
output=-77
로 단축하는 방법이 있나요이
그냥'output = 11 - int (input)'이 아닌가요? – jonrsharpe
대단히 감사합니다 – samrobbins