This Python program demonstrates various concepts such as variables, functions, loops, conditionals, and file I/O. The program manipulates an interest level variable, performs operations on it, and interacts with files for reading and writing.
The project should:
- Be hosted on GitHub.
- Contain at least one variable.
- Contain at least one conditional (
if/else
) statement. - Contain at least a function (
my_cool_func()
). - Have at least one
while
loop or onefor
loop. - Make use of either
import
orread/write
. - Contain a README.md file with the description of your project.
- Defines an
interest_level
variable to represent the level of interest. - Contains a function
check_interest(level)
to evaluate the interest level and provide feedback. - Defines a function
double_interest(level)
to double the interest level. - Utilizes a
for
loop to modify the interest level multiple times. - Writes the final interest level to a file named
interest.txt
. - Reads and displays the content of the
interest.txt
file.
- Make sure you have Python installed on your system.
- Clone this repository or download the
interesting_program.py
file.
- Open a terminal or command prompt.
- Navigate to the directory containing
interesting_program.py
. - Run the program using the command:
python interesting_program.py
. - The program will display the updated interest level in each iteration and write the final interest level to a file.
- The content of the file will be read and displayed.
Interest level after iteration 1: 10
Interest level after iteration 2: 20
Interest level after iteration 3: 40
Interest level from file: 40