我现在有一个txt文件正在编写程序来打印信息。我可以让程序打印信息,但是我收到错误
bff = open('bffs.txt', 'r')
name = bff.readline()
age = int (bff.readline())
name = name.rstrip('\n')
print('My friend', name, 'is', age)
while name != '':
name = bff.readline()
name = name.rstrip('\n')
age = int (bff.readline())
print('My friend', name, 'is', age)
bff.close