Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Write an if statement that checks if a variable 'x' is greater than 10 and prints 'High' if true.
Don’t forget to indent the print statement!
Write a for loop that prints numbers from 0 to 4.
Make sure the print statement is indented within the loop.
What does proper indentation signify in Python?
Think about how other languages handle block definitions.
True or False: Mixing tabs and spaces in Python will not cause any errors.
Consider how readability and structure impact the code.
Write a function that accepts a number and returns whether it’s even or odd. Ensure the proper indentation is used throughout the function.
Focus on providing consistent indentation and think about the structure of functions.
Create a program that prints the first 10 numbers in a sequence or an error message if the number is negative. Pay special attention to indentation in your conditions.
Consider how indentation can change the meaning of loops and conditions.
5 more questions in this section. Enroll free to practise them all.
Enroll free