If and Else

If and Else are used for making decisions. For example, if your average is higher than 60% then you pass, otherwise you fail. If today is your birthday then your age increases, otherwise your age remains the same.

Python Example 1
if(average > 60):
      print(pass)
else:
      print(fail)
 
Python Example 2
 
if(today == birthday):
      age= age + 1
else:
      age
 
For your initial post, provide an example of an if-else scenario that may occur in your life. Convert your example to an actual Python if-else statement.
Provide feedback on the examples provided by your classmates.
Was their example converted to an if-else statement?
Was the if-else statement correct?
Did you learn anything from their post?
Do you have any examples or experiences that relate to their posts?

Leave a Reply

Your email address will not be published. Required fields are marked *