0
이 오류를 검색했지만 답변을 찾지 못했습니다. 간단한 CALC 프로그램 :정수를 곱하는 경우 Python ValueError
import sys
from sys import argv
first = int(sys.argv[1])
operation = sys.argv[2]
second = int(sys.argv[3])
if operation == '+':
total = first + second
if operation == '-':
total = first - second
if operation == '*':
total = first * second
if operation == '/':
total = first/second
print "%d %s %d = %d" % (first, operation, second, total)
I 입력 : python first.py 2/2
내가 -
와 +
와 같은 올바른 출력을 얻을,하지만 난 python first.py 2 * 2
를 입력 할 때 내가 얻을 :
Traceback (most recent call last):
File "first.py", line 7, in <module>
second = int(sys.argv[3])
ValueError: invalid literal for int() with base 10: 'first.py'`
이 아, 잡았다, 당신에게 선생님 감사합니다. – user3763437