Python编程从入门到实践 10-3访客

编写一个程序,提示用户输入起名字;用户做出像影后,将其名字写入到文件guest.txt中

Python2.7

#!/usr/bin/env python
# -*- coding: utf-8 -*-

your_name=raw_input('Please write down your name:')
filename='guest.txt'
with open(filename,'w') as file_object:
	file_object.write(your_name)
	

猜你喜欢

转载自blog.csdn.net/ladysosoli/article/details/79963233