제 문제는 def 함수에서 변수를 사용하고 싶습니다. 어떻게하는지 또는 심지어 할 수 있는지도 모릅니다. 사용중인 코드는 다음과 같습니다.함수에서 변수 가져 오기?
def yandn(prompt='Y/N:'):
no=1
while no==1:
ok=input(prompt)
if ok.lower()==('y'):
a=0
b=0
break
elif ok.lower()==('n'):
a=1
b=0
print('Blah Blah Blah')
c=1
while c==1:
d=input('Blah Blah:')
if d.lower() in valid:
print('Confirm', d, 'as blah.')
yandn()
from yandn import a
if a==1:
c=1
else:
c=0
를 사용
'돌려'yandn – rapvelopment