-1
私は、テキストベースのアドベンチャーゲームのための非常に基本的な戦闘機能を作成しようとしています。私の問題は、この行に関するエラーを特に軽減していることです。Python - 関数呼び出しに割り当てることはできませんか?
random.choice(gold_dropped)+ =金
問題のエラーは、構文エラーです:コールエラーが機能するように割り当てることはできませんし、私は問題の原因とどのようにそれを修正することです何に困惑しています。
フィードバックは一切ありません。
エラーが存在する場所の機能を以下に示します。 "存在しない" 何かに
enemy_health = (random.choice(random_enemy_Health))
enemy_attack = (random.choice(random_enemy_Attack))
print("You are fighting a" ,random.choice(enemies), "with an attack amount of" ,enemy_attack, "and a health amount of" ,enemy_health,".")
while (enemy_health > 0):
enemy_attack - health;
while (health > 0):
attack - enemy_health;
if enemy_health == 0:
print("The enemy has been defeated!")
random.choice(gold_dropped) += gold
if health == 0:
print("You have been defeated! Return back to the Hub and re-prepare yourself!")
hub_travel()
'金+ = random.choice':
は、あなたは、単に(命令の妥当性以下のpython 3.5で確認)中間変数を使用する必要があります。 – jasonharper