Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What is an expression statement?
Think about simple mathematical expressions.
Write a simple assignment statement assigning your name to a variable.
Assignment statements use the `=` sign.
What does a statement do in Python?
Think about what the Python interpreter does with your code.
True or False: A global variable can be accessed inside a function without declaring it.
Consider where the variable is declared.
Create a Python function that uses a global variable to count how many times it has been called.
Think about declaring the variable outside the function.
Write a program that uses a while loop to print odd numbers between 1 and 20 but stop when it reaches 15.
Use both the `if` statement for conditions and `break` for stopping the loop.
7 more questions in this section. Enroll free to practise them all.
Enroll free