Python从入门到实践 第十章课后习题10.1

Python从入门到实践 第十章课后习题10.1,第1张

with open('learning_python.txt') as file_object:
    contents = file_object.read()
    print(contents)
with open('learning_python.txt') as file_object:
    lines = file_object.readlines()
for line in lines:
    print(line.rstrip())
with open('learning_python.txt') as file_object:
    for line in file_object:
        print(line.rstrip())

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/794279.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-06
下一篇 2022-05-06

发表评论

登录后才能评论

评论列表(0条)

保存