In our previous post, I told the basic structure of the if else-if in Python (format) and how to use it in programming. In this section, I will show you the simulation of the examples mentioned in the previous section.
Note:
- Please turn on Interactive Mode so that the program can work properly in the simulation.
- In case of any internet error message in the output, just click on the execute again.
- Please make sure to have stable internet.
- in case 400Error refresh the page and check your internet connection.
Example 01:
This code checks the age and categorizes it into "Child", "Teenager", or "Adult". If "-ve" print a random message.
Example 02:
This code assigns a grade based on the score. When the total Score is 500, also tell the Score.
Example 03:
This code describes the weather based on the temperature.
Example 04:
This code checks if a number is even or odd.
Example 05:
This code checks if a year is a leap year.
Example 06:
This code categorizes BMI into different weight categories.
Example 07:
This code prints the day of the week based on a number.
Example 08:
This code finds the largest of three numbers.
Example 09:
This code checks login credentials and prints a welcome message or an error.
Example 10:
This code simulates a traffic light system, providing instructions based on the signal color.