import random
"1stdigit" = random.randint(0, 9)
"2nddigit" = random.randint(0, 9)
"3rddigit" = random.randint(0, 9)
"4thdigit" = random.randint(0, 9)
print ("1stdigit")
print ("2nddigit")
print ("3rddigit")
print ("4thdigit")
これは私のコードですが、私は問題が何であるか知っている皆さんに尋ねましたが、誰もそれを理解することはできません。python randint関連の構文
括弧の最後をハイライトして、リテラルに割り当てることはできません。スピーチマークを1stdigit 2nddigitなどから取り除くと、異なる構文エラーが発生します – lunt123
エラーがありますか? – theblindprophet
数字でPython識別子を開始することも、文字列リテラルに割り当てることもできません。なぜ4つの別々の値ではなく、単に 'digits = [random.randint(0,9)for _ range(4)]'になるのでしょうか? – jonrsharpe