赞
踩
- file_name='data.txt'
-
- birthday = input('请输入你的4位数生日:')
- data_str = ''
- with open(file_name) as data:
- data_strs = data.readlines()
- for data in data_strs:
- data_str += data.strip()
-
- # print(data_str)
- if birthday in data_str:
- print('你的生日在其中')
-
- else:
- print('你的生日不在其中!')
- file_name = 'study.txt'
-
- with open(file_name,'w') as file:
- file.writelines("i love python 3000 times\n")
- file.writelines("i love python 3000 times\n")
- file.writelines("i love python 3000 times\n")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。