Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jennyonjourney/b71361ef6d1c3ec306db4b3f3672e7f3 to your computer and use it in GitHub Desktop.
Save jennyonjourney/b71361ef6d1c3ec306db4b3f3672e7f3 to your computer and use it in GitHub Desktop.
Python - break & input
i=0
while True:
if i==10:
break #딱 10일때 정확히 stop되고, 더이상 프린터를 하지 않는다.
print("아기 상어",i)
i+=1
print("종료")
print('-----input-------')
rec=input("입력:")
print("결과:", rec)
while True:
print("0을 입력하면 종료 됩니다.")
rr = input("입력:")
if rr=="0":
break
print("결과:", rr)
print("종료")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment