wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Introduction to Python Basics

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

Python is a:

a)

Snake

b)

Programming Language

c)

Game

d)

Movie

2.

Which symbol is used for comments in Python?

a)

//

b)

#

c)

d)

%

3.

What will print('Hello') show on the screen?

a)

Hello

b)

'Hello'

c)

hello

d)

Nothing

4.

Which of these is a Python data type?

a)

Banana

b)

Integer

c)

Car

d)

Pencil

5.

Which function is used to display output in Python?

a)

print()

b)

show()

c)

display()

d)

echo()

6.

Which symbol is used for multiplication?

a)

x

b)

*

c)

^

d)

%

7.

What is the result of 3 + 5?

a)

35

b)

8

c)

53

d)

Error

8.

Strings in Python are written inside:

a)

[]

b)

{}

c)

'' or ""

d)

<>

9.

Which operator is used for division?

a)

/

b)

//

c)

%

d)

-

10.

What does len('apple') return?

a)

4

b)

5

c)

6

d)

Error

11.

Python keywords are:

a)

Reserved words

b)

Any variable name

c)

Colors

d)

Functions only

12.

Which one of these is a loop in Python?

a)

if

b)

while

c)

elif

d)

def

13.

What will print(2 * 3) output?

a)

6

b)

5

c)

23

d)

Error

14.

Which is a correct variable name?

a)

1name

b)

my_name

c)

my-name

d)

print

15.

The symbol for checking equality is:

a)

=

b)

==

c)

!=

d)

<>

16.

Which of these is NOT a Python data type?

a)

int

b)

str

c)

bool

d)

fruit

17.

How do you start a comment in Python?

a)

@

b)

//

c)

#

d)

**

18.

Which function is used to take input from a user?

a)

input()

b)

read()

c)

scan()

d)

type()

19.

What is the result of 10 % 3?

a)

1

b)

3

c)

0

d)

10

20.

Which symbol is used for exponent (power)?

a)

^

b)

**

c)

//

d)

%

21.

Python was created by:

a)

Bill Gates

b)

Guido van Rossum

c)

Elon Musk

d)

Mark Zuckerberg

22.

What will print('Hello' + 'World') show?

a)

Hello World

b)

HelloWorld

c)

Hello+World

d)

Error

23.

The data type of '123' is:

a)

int

b)

str

c)

float

d)

bool

24.

Which brackets are used to define a list in Python?

a)

{}

b)

[]

c)

<>

d)

()

25.

The opposite of True is:

a)

1

b)

False

c)

None

d)

Zero

26.

Which keyword is used for decision making?

a)

if

b)

loop

c)

print

d)

return

27.

A collection of items stored in one variable is called:

a)

integer

b)

string

c)

list

d)

keyword

28.

The function used to find the length of a string is:

a)

count()

b)

size()

c)

len()

d)

length()

29.

To repeat a task many times, we use a:

a)

if

b)

while loop

c)

return

d)

print

30.

Python files are saved with which extension?

a)

.txt

b)

.exe

c)

.py

d)

.java

31.

What will print(10 // 3) output?

a)

3

b)

3.3

c)

4

d)

1

32.

What will print('school'[0]) output?

a)

s

b)

h

c)

o

d)

l

33.

Which operator is used for subtraction?

a)

-

b)

+

c)

*

d)

/

34.

Which of these is a boolean value?

a)

Yes

b)

No

c)

True

d)

Number

35.

What will print(type(3.5)) output?

a)

int

b)

str

c)

float

d)

bool

36.

Which of these is a correct string?

a)

'Hello'

b)

Hello

c)

Hello"

d)

'Hello

37.

What will print(2 ** 3) output?

a)

5

b)

6

c)

8

d)

9

38.

Which operator is used for 'not equal'?

a)

!=

b)

==

c)

=

d)

><

39.

What will print(len([1, 2, 3, 4])) output?

a)

3

b)

4

c)

5

d)

Error

40.

Which of these is used to join two strings?

a)

,

b)

+

c)

*

d)

&