2017-02-21 7 views
-2

こんにちは私はよく見るように見えるコードを作っていますが、それを実行しようとすると、見た目の行に構文エラーが出てきました罰金(写真のように)。私はPythonにはかなり新しく、基本を学んだだけで誰かが解決策を見つけられることを願っています。ここでなぜpython 3.6でランダムな構文エラーが出るのですか?

name = input('what is your name') 
print ('hello' + name) 
print (',it is late december of 2025 and the nuke has been drooped over sheffield. you are our only hope') #this explanes the background story and askes the players name 
print ('please help us. we need you,' + name) 
job = input('please choose a class. medic, gunsman or scientist') 

if job == medic 
bandages = 5 
drugs = 5 
clean_siringes = 5 
dirty siringes = 0 #this sets the players items to the right amount 

health = 100 
food = 100 
water = 100   #this sets the players food, water, health and the citys peoples happiness 
peoples_happiness = 100 

print ('bandages' + bandages) 
print ('drugs' + drugs) 
print ('clean_siringes' + clean_siringes) 
print ('dirty siringes' + dirty_siringes) 
print ('health' + health 
print ('food' + food) 
print ('water' + water) 
print ('peoples_happiness' + peoples_happiness) 

は構文エラーと絵です:

enter image description here

+0

':'がありません。 –

+0

':'は '' medic'という単語をコロンで終わらせる必要があります。 – WhatsThePoint

答えて

1

あなたはif声明

if job == medic: 

の末尾にコロンが不足しているプラ​​スあなたが行をインデントする必要がありますそれらはif句の中にあります。

+1

コメントを残して、単純な入力ミスとして閉じます。 –

+0

彼は 'if job ==" medic "。 –

関連する問題