Advanced Programming with Python

1 Write a program that guesses a number in a maximum of five steps.

Use three libraries: sys, time and random.

File Download
2 Write a program that writes a class object to a binary file and then reads and displays it.

The binary file is used to manage different instances of a class.

File Download
3 Write a program that shows two different ways to write to and read from a text file.

The seek sub-program is used to change the internal position of the file.

File Download
4 Write a program that shows how to use append mode in a text file.

The append mode is the state where at the beginning of the file opening, the position of the file is placed at the end of the file.

File Download
5 Write a program that displays the specifications of the current file and sets the position of the text file in a specific position.

The current file refers to the file that is running.

File Download
6 Write a program that demonstrates the use of the tell function in text files.

The tell function in text files shows the next position of the file position indicator. This action is used to make the right decision whether or not to continue reading / writing in the file.

File Download
7 Write a program to open a text file as r + and write to it.

The r+ mode in text files is the mode used for reading, which can also be written while reading.

File Download
8 Write a program that shows how to use the a + mode in text files.

In a + mode, in addition to placing the file position indicator at the end of the file, it is possible to read and write in the file.

File Download
9 Write a program that shows the line-by-line reading of the file.

File Download
10 Write a program that reads several lines of a file at once and then processes them.

File Download
Document