#10-1Python学习笔记
file_path = 'E:\python_work\example\learing_python.txt'
with open(file_path) as file_object:
#print(file_object.read())
lines = file_object.readlines()
# for line in lines:
# print(line.rstrip())
string = ''
for line in lines:
string += line.rstrip()
print(string)
#10-2 C语言学习笔记
string = ''
for line in lines:
string += line.replace('Python','C')
print(string)
#10-4访客名单
user_infor = input('Please enter your name: ')
print("Hello, " + user_infor.title())
file_path = 'E:\python_work\example\guest_book.txt'
with open(file_path,'a') as file_object:
file_object.write(user_infor.title() + 'has a visist your space\n')
#10-5关于编程的调查
filename = 'reason_book.txt'
responses = []
while True:
response = input("\nWhy do you like programming? ")
responses.append(response)
continue_poll =
Python编程从入门到实践第10章习题答案
最新推荐文章于 2023-09-07 15:36:26 发布
![](https://img-home.csdnimg.cn/images/20240611030827.png)