wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Introduction to Python Programming

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What is Python?

a)

High-level programming language

b)

Easy to read & write

c)

Used for Web development, Data Science, AI & ML, Automation, Games & Apps

2.

What is a variable?

a)

A name used to store data

b)

A type of function

c)

A method to execute code

3.

What does the 'print' function do?

a)

Displays output to the console

b)

Stores data in a variable

c)

Defines a function

4.

What is the output of print('Hello World')?

a)

Hello World

b)

Hello

c)

World

5.

What is the correct way to declare a variable in Python?

a)

age = 25

b)

int age = 25

c)

var age = 25

6.

Python code runs __________.

a)

Bottom to top

b)

Randomly

c)

Line by line

7.

What will print(type(age)) return if age = 25?

a)

int

b)

str

c)

float

8.

What is the output of print('OK')?

a)

OK

b)

Error

c)

Nothing

9.

What is the purpose of comments in Python?

a)

To explain code

b)

To execute code

c)

To define variables

10.

What will happen if indentation is incorrect?

a)

An error will occur

b)

The code will run

c)

Nothing will happen

11.

What is the correct syntax to take user input?

a)

name = input('Enter name: ')

b)

name = read('Enter name: ')

c)

name = get('Enter name: ')

12.

What type of number is 'height = 5.8'?

a)

Float

b)

Integer

c)

String

13.

What will print(type(name)) return if name = 'Abhishek'?

a)

str

b)

int

c)

bool

14.

What is the output of print('Welcome to Python')?

a)

Welcome to Python

b)

Welcome

c)

Python

15.

What is the correct way to define a string in Python?

a)

name = 'Abhishek'

b)

name = Abhishek

c)

name = ""Abhishek""

16.

What will happen if you try to print a variable that hasn't been defined?

a)

An error will occur

b)

It will print None

c)

It will print an empty string

17.

What is the output of print('I will become a Python Pro')?

a)

I will become a Python Pro

b)

I will become a Pro

c)

I will become a Python

18.

What is the correct way to write a comment in Python?

a)

# This is a comment

b)

// This is a comment

c)

/* This is a comment */

19.

What will the following code print? print('Name:', name)

a)

Name: Abhishek

b)

Name:

c)

Abhishek

20.

What is the output of print('Age:', age) if age = 25?

a)

Age: 25

b)

Age:

c)

25