首先写作一篇自我介绍的英文文章,然后编写程序,先追加一行姓名、学号到原有文件,然后读取文档中的全部内容,并打印输出。
时间: 2023-10-06 08:04:25 浏览: 98
编写一个程序,输出该文本文件中含有的单词总数,分析一个文本文件(英文文章)中 各个词出现的频率,输出该文本文件中所有单词的列表,并与出现次数一起打印出来
My Self-Introduction
Hello everyone, my name is [Your Name] and I am currently a [Your Major] student at [Your University]. I am passionate about [Your Interests] and enjoy [Your Hobbies]. In my free time, I also like to [Other Activities].
I have gained extensive experience in [Your Field] through internships at [Companies/Organizations] and have also participated in [Your Achievements]. These experiences have allowed me to develop [Your Skills] and deepen my understanding of [Your Field].
In the future, I am excited to [Your Future Goals] and hope to make a positive impact in [Your Desired Industry/Field]. Thank you for taking the time to read my self-introduction.
程序如下:
```python
# Append name and student ID to the file
with open('self-introduction.txt', 'a') as f:
f.write('\n[Your Name]\n[Your Student ID]')
# Read the entire file and print the contents
with open('self-introduction.txt', 'r') as f:
contents = f.read()
print(contents)
```
阅读全文