![](/img/trans.png)
[英]Python 2.7.8 print statement “Syntax Error: invalid syntax” in terminal (ubuntu 14.04) but running well on vim, why?
[英]If Statement Python 2.7.8,Invalid syntax
问题是在if语句后的if语句无效语句。请帮助。
print("Welcome to the Project Hotel ")
print("Enter the following Pins to Enter the Following Areas : ")
print("A = Pin for the Visitor Management is 1111")
print("B = Pin for the Room Management is 2222")
print("C = Pin for the Bill Management is 3333")
A=int(input("Enter the 4-Digit Pin here - "))
If A==1111:
print("Welcome to the Visitor Management Section")
if A==2222:
pass
if A==3333:
print("Total Amount =(Total Room amount + Food amounts + Extras)")
print("VAT here is 4.5% * (Total Amount)")
print("Final Amount = Total amount + VAT")
Hotel.close()
“if”语句应以小写形式输入。 检查你的缩进,它可能是问题。
你在第一个if语句中使用了大写字母I.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.