Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Fundamentals for Grade 9 Students

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the output of 'print(5 + 3)' in Python?

a)

8

b)

7

c)

2

d)

10

2.

Explain the difference between '==' and 'is' in Python.

a)

'==' compares values, 'is' compares types.

b)

'==' compares values, 'is' compares memory addresses.

c)

'==' compares memory addresses, 'is' compares values.

d)

'==' compares memory addresses, 'is' compares types.

3.

What data type is 'True' in Python?

a)

list

b)

integer

c)

string

d)

boolean

4.

How do you write an if-else statement in Python?

a)

if condition: code_block_for_false_condition else: code_block_for_true_condition

b)

if condition: code_block_for_true_condition else: code_block_for_false_condition

c)

if condition: code_block_for_true_condition

d)

if condition: code_block_for_true_condition else: code_block_for_false_condition

5.

What is the purpose of a 'for' loop in Python?

a)

To iterate over a sequence and execute a block of code for each item in the sequence.

b)

To perform mathematical calculations

c)

To define classes and objects

d)

To create conditional statements

6.

Define a function in Python that takes two parameters and returns their sum.

a)

def sum_two_numbers(a, b): return a + b

b)

def add_numbers(a, b): return a + b

c)

def calculate_sum(a, b): return a + b

d)

def sum(a, b): return a + b

7.

How do you take user input in Python?

a)

get_input() method

b)

user_input() function

c)

read_input() function

d)

input() function

8.

Explain the concept of a list in Python.

a)

A list in Python is a data structure that holds an unordered collection of items.

b)

A list in Python is a data structure that holds an ordered collection of items. It is denoted by square brackets [] and can contain elements of different data types. Lists are mutable, meaning their elements can be changed after creation.

c)

A list in Python is denoted by curly brackets {}.

d)

Lists in Python can only contain elements of the same data type.

9.

What is a dictionary in Python and how is it different from a list?

a)

A dictionary in Python is a collection of key-value pairs, where each key is unique. It is different from a list in that lists are ordered collections of items accessed by index, while dictionaries are ordered collections accessed by keys.

b)

A dictionary in Python is a collection of key-value pairs, where each key is unique. It is different from a list in that lists are unordered collections of items accessed by index, while dictionaries are ordered collections accessed by keys.

c)

A dictionary in Python is a collection of key-value pairs, where each key is unique. It is different from a list in that lists are ordered collections of items accessed by index, while dictionaries are unordered collections accessed by keys.

d)

A dictionary in Python is a collection of key-value pairs, where each key is unique. It is different from a list in that lists are ordered collections of items accessed by index, while dictionaries are ordered collections accessed by values.

10.

What are the fundamentals of programming that every Python programmer should know?

a)

Operators, memory management, recursion, error handling

b)

Syntax, algorithms, debugging, testing

c)

Loops, classes, inheritance, libraries

d)

Variables, data types, control structures, functions, basic input/output operations