Script Valley
Python: Complete Language Course
Python Basics and Syntax/Assessment

Practice & Assessment

Test your understanding of Python Basics and Syntax

Multiple Choice Questions

5
1

What does `10 // 3` evaluate to in Python?

2

Which of the following variable names is invalid in Python?

3

What is the output of `print(bool(0), bool(""), bool([]))`?

4

What does the `continue` statement do inside a loop?

5

What is the result of `type(10 / 2)` in Python 3?

Coding Challenges

1
1

FizzBuzz 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.

Easy

Mini Project

1

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.

Easy