Conditional Statements
Use if, elif and else to make decisions in Python programs.
Learn by experimenting
Study the Python code, run it, change values and observe the output. Practical experimentation is an important part of learning programming.
Python Code
Python runs directly in your browser.
marks = 75
if marks >= 70:
print('Excellent')
elif marks >= 50:
print('Good')
else:
print('Keep learning')
Python Output
Program output appears here.
Test your understanding
Choose the best answer.
Which keyword is used to define a function in Python?