print "You've entered a wording system!"
print "What words do you want?"
while False:
word1 = raw_input('enter your word:')
word2 = raw_input('enter your word:')
print word1
print word2
if len(word1)>len(word2):
word_difference = len(word1) - len(word2)
print word1, "is", word_difference, "letters longer than", word2
elif len(word2)>len(word1):
word_difference = len(word2) - len(word1)
print word2, "is", word_difference, "letters longer than", word1
elif len(word1) == len(word2):
print word1, "has same number of letters as", word2
repeat = raw_input("Would you like to enter two more words?(y/n)")
if repeat == "y":
y == False
그래서 질문이 "Would you like to enter two more words" is == y
당신을 요구하는 경우 repeat = raw_input(asking fort two more words)
에 word1 = raw input
에서 반복 코드를 만들려면 및 no == Good bye!
파이썬에서 프로세스를 반복하는 법을 알고 싶습니까?
당신은 이미 while 루프를 작성하는 방법을 알고 있습니다 ... 다른 것을 사용하지 않으시겠습니까? – James
'False'는 실행되지 않습니다. 왜냐하면, 음, True가 아니기 때문입니다. – cdarke
모든 코드는 첫 번째 루프에 있어야하며, 'repeat'이 "y"와 동일한 한 실행해야합니다 (루프 이전에 적절하게 초기화 된 'repeat'로). – chepner