The Ministry of Science and Higher Education of the Russian Federation
Federal State Budget Education Institution of Higher Education
IRKUTSK NATIONAL RESEARCH TECHNICAL UNIVERSITY
Institute of Information Technology and Data Science
Programming
Report for the Laboratory Work №2
«File Handling»
Done by a student of group ИИКб-21 / Artificial Intelligence
Surafel Teka Zewdie
Signature
Checked by Ph.D., Lecturer, Senior Researcher
Nguyen The Long
Signature
Irkutsk 2022
1
1. Write a Python program to append text to a file and display the text.
2. Write a Python program to find the longest words
3. Write a Python program to count the frequency of words in a file
2
4. Write a Python program to read a random line from a file
5. Write a Python program that takes a text file as input and returns the number of words of
a given text file. Note: Some words can be separated by a comma with no space.
3
6. Write a Python program to read a file line by line store it into a variable.
Contain of [Link]:
What is Python language?
Python is a widely used high-level, general-purpose,
interpreted, dynamic programming [Link] design philosophy
4
emphasizes code readability, and its syntax allows programmers
to express concepts in fewer lines of code than possible in
languages such as C++ or Java.
Python supports multiple programming paradigms, including
object-oriented, imperative and functional programm