私は自分のプログラム(コード)を複製せずに繰り返す方法を見つけようとしましたが、私が読んだ答えはすべて意味がありませんでした。誰か助けてくれますか? これは私が永遠の真の条件がありますwhileループを行います私のプログラムを複製せずに繰り返す方法
import random
words=['hello','run','apple','day','month','cat','dog','bird','car','water']
word=random.choice(words)
length=len(word)
life=50
print('\t\tGuess the word!')
print('instructions: Guess the word. The word is only written by the alphabets.')
pn=input('Type your player name :')
print('Use this to help you! :',words)
print('The length of the word is',length,'letters')
fl=input('Guess the first letter of the word! :')
if fl==word[0]:
print('Whoah! Nice guess',pn)
else:
life=life-1
print('Nice guess but wrong. Try again! You have',life,'lives left!')
を聞いたことがありますか? – miindlek
これらの回答のうち、どの部分が意味をなさないのですか?あなたはおそらく同じ回答を受け取るでしょう – Sayse