我正在尝试为我的GCSE工作编写一个菜单,但我最终在半冒号上出现语法错误。 以下是以下计划:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<h2 class="tm section-title margin-l-10">Normal Cards<button class="tm bg-dark btn-tiny margin-b-10 float-r js-show-code">show code</button></h2>
<div class="grid-100">
<code>
<div class="<span class="tm bg-win blue">tm card</span>">
<span class="tm lightyellow">...</span>
</div>
</code>
</div>
我认为问题出在&#39;如果choice_input ==&#34; a&#34;:&#39;请帮助!
答案 0 :(得分:0)
你犯了一些错误,主要是打印功能。你为什么要打印变量而不是调用print语句?在这里看:
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