특정 이름을 입력 할 때 여분의 줄을 인쇄하는 간단한 python 스크립트가 있습니다.이 기능은 3.3.4에서 작동하지만 2.7에서 실행하려고하면 작동합니다 .6 이름이 입력되었을 때 여분의 줄이 인쇄되지 않았습니다. 나는 파이썬 버전 사이의 변경 내역을 살펴 보았습니다. 도움말 크게 감사드립니다.Python 2.7.6 while 및 If
while True:
name =raw_input('Piggy: What is your name?\n').strip()
if len(name.split()) == 1:
name = name.title()
break
else:
print("Ahhhj Make it shorter or actually enter a name. If you have a name like 'Mary Joe', please separate it by using a '-'")
if name ==('dawson'):
print('Hey Developer.')
'raw_input'은 Py 3.x에 없으므로 작동하지 않습니다. – thefourtheye
@thefourtheye 나는 파이썬 2.7.6에서이 글을 쓰고 있는데, 다운 그레이드해야만했다. – dawsondiaz