wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Q1 Introduction to Python

Total questions: 15

Worksheet time: 11mins

Name
Class
Date
1.

What is Python?

a)

A type of snake

b)

A high-level programming language

c)

A popular web browser

d)

A type of pasta

2.

Who is the creator of Python?

a)

Linus Torvalds

b)

Mark Zuckerberg

c)

Steve Jobs

d)

Guido van Rossum

3.

Which of the following is true about Python's indentation?

a)

It is optional and doesn't affect the code's execution

b)

It is used for code organization and is required for code blocks

c)

It is only used for comments

d)

It is used to create loops in Python

4.

What does the "print" function do in Python?

a)

It takes user input

b)

It displays text or values on the screen

c)

It performs mathematical calculations

d)

It creates a new variable

5.

What is the result of the expression 5 + 3 * 2?

a)

10

b)

16

c)

11

d)

26

6.

Which symbol is used for comments in Python?

a)

//

b)

#

c)

/* */

d)

--

7.

Which data type is used to store a sequence of characters in Python?

a)

int

b)

float

c)

str

d)

bool

8.

How do you declare and initialize a variable in Python?

a)

var x = 5

b)

let x = 5

c)

x = 5

d)

int x = 5

9.

Which of the following is a valid way to create a list in Python?

a)

(1, 2, 3)

b)

[1, 2, 3]

c)

{1, 2, 3}

d)

"1, 2, 3"

10.

What is the purpose of the "if" statement in Python?

a)

To create a loop

b)

To define a function

c)

To execute code conditionally

d)

To perform mathematical calculations

11.

What is the output of the following code snippet?

my_list = [1, 2, 3, 4, 5]

print(my_list[2])

a)

2

b)

3

c)

4

d)

5

12.

Which of the following is a valid Python comment for a multi-line statement?

a)

// This is a comment

b)

# This is a comment

c)

/* This is a comment */

d)

''' This is a comment '''

13.

Which of the following is an example of a Python keyword

a)

print

b)

function

c)

variable

d)

None of the above

14.

What is the primary purpose of the "elif" keyword in Python?

a)

To define a function

b)

To specify the exception handling code

c)

To add an "else if" condition in an if-else statement

d)

To create a loop

15.

What is the result of the following code snippet?

x = 10

y = 5

result = x > y

a)

result is assigned the value 10

b)

result is assigned the value True

c)

result is assigned the value False

d)

This code will result in an error