다음 파이썬 코드가 즉시 첫 번째 줄을 실행하지 않고 how many years?
을 프롬프트하지 않는 이유는 무엇입니까?파이썬 코드가 첫 번째 줄 프롬프트를 실행하지 않습니다.
years=input('how many years?')
amount=input('how much money?')
if amount < 10000:
interest = 1.1
total = amount * interest
print total
else amount >= 10000:
interest = 1.2
total = amount * interest
print total'
대신에 무엇을합니까? 또한,이 Python 2 또는 3입니까? 파이썬 2에서'input' 대신에'raw_input'을 사용하고 싶을 것입니다. –
print 문으로 판단하면 파이썬 2입니다. –
파이썬 2이지만 python 2 입력이 eval (input()) 파이썬 3. 그것은 문자열 대신 숫자를 얻는 방법입니다. – pycoder112358