TMC - 9 Digital Tech Semester 2
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto mode

if statements

Link to view video at TMC

Basic if

Python

if condition:
    statements
regularFlow

C#

if( condition ){
    statements;
}
regularFlow;

if/else

Python

if condition:
    statements
else:
    statements
regularFlow

C#

if( condition ){
    statements;
}else{
    statements;
}
regularFlow;

chained if

Python

if condition:
    statements
elif otherCondition:
    statements
else:
    statements
regularFlow

C#

if( condition ){
    statements;
}else if( otherCondition ){
    statements;
}else{
    statements;
}
regularFlow;