all = 'pai.txt'
with open(all) as file_object:
number = file_object.readlines()
num = ''
for i in number:
num += i.rstrip()
birthday = input(print('Please enter the birthday: ')
if birthday in num:
print('Your birthday: ' + birthday +
'is in the pai. ')
else:
print('Your birthday: ' + birthday +
'is not in the pai. ')
提示:
if birthday in num:
^
SyntaxError: invalid syntax
birthday = input(print('Please enter the birthday: ')
这后面少个括号 改成
birthday = input(print('Please enter the birthday: '))
如果觉得答案对你有帮助,请点击下采纳,谢谢~
所以你的代码里没有if birthday in num:吗?