pythonでモジュールがimportできません
python
1import word_list 2import random 3from replit import clear #importできない 4 5life = 6 6 7chosen_word = random.choice(word_list.word_list) 8#chosen_word = random.choice(word_list) でいい 9 10sample_word = [] 11 12for i in range(0,len(chosen_word) ): 13 sample_word.append("_") 14 #sample_word += "_" 15 16judge = False 17 18from logo import logo 19 20print(logo) 21 22while not judge: 23 guess = input("guess a letter :").lower() 24 clear() 25 for letter in range(0,len(chosen_word)): 26 if chosen_word[letter] == guess: 27 sample_word[letter] = guess 28 29 print(sample_word) 30 if guess not in chosen_word: 31 life -= 1 32 from logo import stages 33 print(stages[life]) 34 if life == 0: 35 print("game over") 36 judge = True 37 if "_" not in sample_word: 38 judge = True 39 print("you win")
デバックをしたらform replit import clear の部分でエラーが出て止まります。
エラー内容は
No module named 'replit'
と出ます。
replitというモジュールはないのでしょうか?
それともインストールなどをすればいいのでしょうか?
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。