Project Description
Create a program that suggests random workout routines based on user input, making fitness more engaging and personalized.
How the Program Works
The program starts by letting the user enter a workout type. For example, in the demo below, the user has entered “strength”.
Once the user presses Enter, the program selects a random exercise (i.e., planlk) from the strength category and prints out the messages as shown below:
To make your work easier, we are providing some strength exercises here:
["Push-ups", "Squats", "Lunges", "Plank", "Dumbbell Press"]
Some cardio exercises:
["Jumping Jacks", "Burpees", "Running in Place", "Jump Rope", "High Knees"]
And some flexibility exercises:
"Yoga Stretch", "Hamstring Stretch", "Toe Touches", "Cat-Cow Stretch", "Shoulder Rolls"]
How This Project Matters in the Real-World
This project introduces the concept of using functions and randomness to create dynamic programs. In real-world applications, fitness apps and training programs use similar logic to generate workout plans tailored to user preferences. The random library could also be used in real-world applications, but instead of printing the workouts in the terminal, they would be shown in a graphical user interface instead.
Prerequisites
Required Libraries: random
You don’t need to install any libraries.
Required Files: No files are needed for this project.
IDE: You can use any IDE on your computer to code the project.
Danger Zone
Below you will find the complete code solution for this project.