--Originally published at Programming Fundaments
In python 3 you have to use conditionals to tell the program to make a desition. The fisrt conditional we are gonig to useis “if” example:
If it rains tomorrow, I will do the following:
- tidy up the cellar
- paint the walls
- If there is some time left, I will
- do my tax declaration
Otherwise, I will do the following:
- go swimming
go to the cinema with my wife in the evening
as simple as that, basically you are making the program to make a desicion depeding of the variable and parameters you input:
if (raining_tomorrow) {
tidy_up_the_cellar();
paint_the_walls();
if (time_left)
do_taxes();
}
Examples and more from: http://www.python-course.eu/python3_conditional_statements.php