
Learning Objectives
In this challenge we are going to focus on accessing a text file in Python to:
- Read the content of the file line by line,
- Write data to a new file.
Before completing this challenge, you should read about the main file handling operations using Python.
Your Challenge
Your challenge consists of writing a Python script that could be used by a teacher to take the register at the beginning of the lesson.
Your program will need to:
- Read the text file called classList.txt, line by line.
- For each student (line of the text file) the program should ask the teacher if the pupil is pesent (“/” code), absent for medical reasons or illness (“M” code), on a school trip (“T” code), or absent with no reason provided yet (“X” code).
- The program should store the teacher’s input alongside with the name of each pupil into a new text file called “register.txt”.
To complete this challenge you will need to use the class list text file:

ClassList.txt
Python Code
Complete the Python code below…

Solution...
The solution for this challenge is available to full members!Find out how to become a member:
➤ Members' Area


For this challenge you will design and write a program to play against the computer.


Converting Distances

Converting Temperatures
Converting Weights
Time Conversion
Have you ever seen a lightning flash or heard the thunder of lightning and wondered how close you were from the ligthning strike? Have you noticed that there is always a delay between the flash of light and the clap of thunder when a lightning occurs?





Shopping during the sales can sometimes be very confusing. With discounted prices at 10%, 20%, 50% or even 70%!
Degree Fahrenheit (°F) and Degree Celsius (°C) are the main two units to measure temperature.
The story tells us that long long ago the great Sultan of India loved to play games. As he started to get bored of the games that were present at the time he asked a wise man who lived in his kingdom to come up with a new game.
To the Sultan’s surprise, the wise man did not ask for any gold. Instead he only had one request: He asked just for a few grains of rice in the following manner: the sultan was to put a single grain of rice on the first chess square, two grains on the second square, four on the third square and carry on doubling this number on every consequent square to fill up all 64 squares of the chessboard.

