learning_python 文件
In python you can do something very boring!
In python you can make your own game!
In python you can find a good job!
In python you can finish your homework easy!
代码
filename = 'learning_python.txt'
with open(filename) as file_object:
lines = file_object.readlines()
pi_string = ' '
for line in lines:
line.replace('python', 'C')
pi_string += line.lstrip()
print(pi_string)
结果
In python you can do something very boring!
In python you can make your own game!
In python you can find a good job!
In python you can finish your homework easy!Process finished with exit code 0