Practice & Assessment
Test your understanding of Python Basics and Syntax
Multiple Choice Questions
5What does `10 // 3` evaluate to in Python?
Which of the following variable names is invalid in Python?
What is the output of `print(bool(0), bool(""), bool([]))`?
What does the `continue` statement do inside a loop?
What is the result of `type(10 / 2)` in Python 3?
Coding Challenges
1FizzBuzz with a twist
Write a program that prints numbers from 1 to 50. For multiples of 3, print 'Fizz'. For multiples of 5, print 'Buzz'. For multiples of both, print 'FizzBuzz'. Input: none (hardcoded range). Output: 50 lines to stdout. Constraints: use a for loop and if/elif/else. Do not use string concatenation tricks. Estimated time: 15-20 minutes.
Mini Project
Simple Number Guessing Game
Build a CLI number guessing game. The program picks a random integer between 1 and 100 using `random.randint`. The user guesses via `input()`. After each guess, print 'Too high', 'Too low', or 'Correct! You guessed it in N tries.' Keep looping until correct. Track the number of attempts with a counter variable. Use a while loop, if/elif/else, int conversion, and comparison operators. Bonus: reject non-numeric input gracefully with a try/except block.
