if 함수 내부에서 함수를 호출하려하지만 작동하지 않습니다. 이것은 파이썬 사용에 대한 나의 첫 번째 시도 중 하나입니다. 내가 도대체 뭘 잘못하고있는 겁니까?if 문 내부에서 함수 호출하기
#!/usr/bin/python
menu = raw_input ("Hello, please choose form following options (1,2,3) and press enter:\n"
"Option 1\n"
"Option 2\n"
"Option 3\n")
if menu == str("1"):
savinginfile = raw_input ("Please, state your name: ")
option1()
elif menu == str("2"):
print ("Option 2")
elif menu == str("3"):
print ("Option 3")
def option1():
test = open ("test.txt", "rw")
test.write(savinginfile)
print ("Option 1 used")
test.close()
무엇이 작동하지 않습니까 ?? 오류 코드가 나옵니까 ?? 제발 좀 더 자세히 설명해주세요. – jramirez