質問編集履歴
3
タイトルの修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
同じ文字列を
|
1
|
+
同じ文字列を比較しているのに同じ文字列だと判定されないので、同じ文字列だと判定できるようにしたい
|
body
CHANGED
File without changes
|
2
str.pyのif str(correct_words[q_nums[q_nums_index]]) is str(ans_words[q_nums_index]): の is を == に変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -38,7 +38,7 @@
|
|
38
38
|
q_nums=[0,3,4]
|
39
39
|
q_nums_index=0
|
40
40
|
|
41
|
-
if str(correct_words[q_nums[q_nums_index]])
|
41
|
+
if str(correct_words[q_nums[q_nums_index]]) == str(ans_words[q_nums_index]):
|
42
42
|
print("回答:"+str(correct_words[q_nums[q_nums_index]]))
|
43
43
|
print("入力した答え:"+str(ans_words[q_nums_index]))
|
44
44
|
print("\n"+str(q_nums_index+1)+":正解")
|
1
I have an apple. のピリオドを無くしました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
###~配列について~
|
9
9
|
正解となる文字列は単語ごとにリストとして、correct_wordsに格納されています。
|
10
|
-
["I have an apple
|
10
|
+
["I have an apple"]から
|
11
11
|
["I","have","an","apple"]
|
12
12
|
という感じになっています。
|
13
13
|
|