Python 我在第42行(最后第4行)遇到语法错误,我无法修复它。有人能帮忙吗?
如果这真的是你的代码,你的打印是大写的 打印退出再见 另外,我刚刚运行了您的代码,您的else子句中有一些不正确的缩进:Python 我在第42行(最后第4行)遇到语法错误,我无法修复它。有人能帮忙吗?,python,Python,如果这真的是你的代码,你的打印是大写的 打印退出再见 另外,我刚刚运行了您的代码,您的else子句中有一些不正确的缩进: 试试小写打印?{回答至少30个字符,请忽略}查看您已将打印语句大写。必须是打印而不是打印。表示退出再见的行 def main(): # This code reads in data.txt and loads it into an array # Array will be used to add friends, remove and list #
试试小写打印?{回答至少30个字符,请忽略}查看您已将打印语句大写。必须是打印而不是打印。表示退出再见的行
def main():
# This code reads in data.txt and loads it into an array
# Array will be used to add friends, remove and list
# when we quit, we'll overwrite original friends.txt with
# contents
print"Welcome to the program"
print "Enter the correct number"
print "Hockey fan 1, basketball fan 2, cricket fan 3,Numbers of favorite players-4"
choice = input("Select an option")
while choice!=3:
if choice==1:
addString = raw_input("Who is your favorite player??")
print "I love Kessel"
elif choice==2:
remInt = raw_input("Do you think that the Cavaliers will continue ther loosing ways?")
print "I think they can beat the Clippers"
else:
inFile = open('data.txt','r')
listNumbers = []
for numbers in inFile:
listNumbers.append(numbers)
print numbers
inFile.close()
print "Cricket is a great sport"
def quit():
Print "Quitting Goodbye!"
if __name__ == '__main__':
main()
inFile = open('data.txt','r')
listNumbers = []
for numbers in inFile:
listNumbers.append(numbers)
print numbers
inFile.close()