name = input('Please input your name : ')
with open('guest.txt','a') as file_object:
file_object.write(name+'\n')
print('---10-2习题答案-----')
while name != 'quit':
name = input('Please input your name : ')
input('Welcom '+name)
with open('guest.txt','a') as file_object:
file_object.write(name+'\t')
with open('guest.txt') as file_object:
contents = file_object.read()
print(contents)
print('----10-6习题答案----')
try:
num1 = input('input num1: ')
num2 = input('input num2: ')
sum = int(num1)+int(num2)
print(sum)
except TypeError:
print('The input is not a num!')
except ValueError:
print('The input is not a num!')