2016-11-30 2 views
0

私のGCSE作業用のメニューをプログラムしようとしていますが、セミコロンで構文エラーが発生します。ここ は以下のプログラムです:セミコロンの構文エラー?

def choice() : 
    print = ("Welcome to the troubleshooting System") 
    print = ("") 
    print = ("a. Samsung") 
    print = ("") 
    print = ("b. Android") 
    print = ("") 
    print = ("c. Apple") 
    print = ("") 
    print = ("d. Blackberry") 
    print = ("") 
    print = ("e. Sony") 
    choice_input = input(str(" Please select the letter of the brand of phone that you are using") 

         if choice_input == "a": 
         Samsung() 

         elif choice_input == "b": 
          Android() 

         elif choice_input == "c": 
          Apple() 

         elif choice_input == "d": 
          Blackberry() 

         elif choice_input == "e": 
          Sony() 

私は問題は「choice_input場合== 『A』:」であると思います助けてください!

+0

「if」ステートメントで呼び出す関数を作成しましたか? – Inconnu

+0

pythonでのインデント問題、 'Samsung()'はインデントされて一致する 'if'文に属するようにする必要があります。また、エラーがあると答えたときには、どの行にエラーがあるのか​​を含めるべきです – EdChum

+0

' print = (「もの」) '??技術的には、これは間違っているわけではありませんが、あなたが期待することはしません。 – ForceBru

答えて

0

あなたは主に印刷機能をいくつか間違えました。なぜあなたは印刷文を呼び出す代わりに印刷変数を作成していますか?ここで見る:

import time 
import sys 
#The program boots up 
print("Loading...") 
time.sleep(2) 
# 'Def' allows this program to present a menu toward the user in which he can decide what phone 

def choice() : 
    print ("Welcome to the troubleshooting System") 
    print ("") 
    print ("a. Samsung") 
    print ("") 
    print ("b. Android") 
    print ("") 
    print ("c. Apple") 
    print ("") 
    print ("d. Blackberry") 
    print ("") 
    print ("e. Sony") 
    choice_input = input(str(" Please select the letter of the brand of phone that you are using")) 
    if choice_input == "a": 
     Samsung() 

    elif choice_input == "b": 
     Android() 

    elif choice_input == "c": 
     Apple() 

    elif choice_input == "d": 
     Blackberry() 

    elif choice_input == "e": 
     Sony() 

choice()#call the function to start/execute 
+0

私は自分が間違って行ったことを理解すると思うアキレス、ありがとう! –

関連する問題