The most important thing in self-learning a language is to give yourself feedback in time, so it is very important to often write some small programs to cultivate a sense of language. After writing, you can summarize the scattered knowledge points used in the program.
The knowledge points used in this program are:
1. Input and output functions (input, print)
2. Assignment statement (=)
3. Define variables (naming conventions for variable names)
4. Data type conversion (int)
5. Import modules (random, os)
6. Module method calls (.randint, .system)
7. Nesting of "while-else loop" and "if-else conditional judgment"
8. Use of escape characters ( )
9. Python comment specification (# and comment content are best left blank)
The source code of the entire program is attached. In order to prevent friends who directly copy the code, the editor is here to show everyone in the format of pictures in order to let everyone learn the code by themselves and enhance the understanding of the code!
This is the effect after running: