# 使用.split更改元素
s = ['a.png', 'b.jpg', 'c.jf', 'f.jpeg', 'gg.jpg']
with open('picture.txt', 'w') as f:
for i in s:
pic_list = i.split('.')
new_pic = pic_list[0] + '.jpg'
f.write(new_pic + '\n')
import random
with open('data.txt', 'w') as f:
for o in range(1000):
f.write(str(random.randint(1, 100)) + '\n')
count = "1"
while(count):
name = input('请输入姓名:')
number = input('请输入电话:')
places = input('地址:')
count = input('是否继续输入,继续请按“1”,退出请按任意键。')
with open('info.txt', 'a') as f:
f.write(name + ',' + number + ',' + places + '\n')