#Mastery16

Use of else

Sometimes when the condition in an if statement evaluates to false, it would be nice to execute some code instead of the code executed when the statement evaluates to true. The “else” statement effectively says that whatever code after it (whether a single line or code between brackets) is executed if the if statement is FALSE.

 

CC BY 4.0 #Mastery16 by Aurora Alvarado is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.