第一个Python程序

#print ("hello world!")
string = 'hello world'
f = open('hello.txt', 'w')  #以写的方式打开文件
f.write(string)     #将字符串写入到打开的文件中
f.close()           #闭文件
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务