2017-05-07 80 views
-7

我試圖讓用戶輸入一個單詞的答案,然後,他們輸入的答案將在新問題中打印。 這是我的代碼:Python問題與「輸入」

device= input ("what device do you have?") 

if (device== "phone"): 

    print(" ") 

elif (device== "samsung"): 

    pass 

Power = input ("what 'power' make do you have?") 
+8

你的問題是什麼? – kennytm

+0

2017怎麼樣?與這個問題有什麼關係? –

+1

'Power = input(「what」+ device +「make you do have?」)'這是你在問什麼? –

回答

0

你的意思是這樣的嗎?

answer1 = input("what device do you have? ") 
answer2 = input("looks like you are using '{0}' as a device, but why? ".format(answer1)) 

print(answer2)