wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Programming Quiz

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What is Python?

a)

a) A low-level programming language

b)

b) A type of database management system

c)

c) A high-level, versatile programming language

d)

d) A graphic design tool

2.

What is the main difference between Scratch and Python regarding syntax?

a)

a) Scratch requires correct indentation, while Python does not.

b)

b) Scratch has no syntax errors due to its block structure, whereas Python requires correct syntax.

c)

c) Python uses visual blocks, and Scratch uses typed text.

d)

d) Scratch is more flexible than Python.

3.

Which mode allows Python commands to be typed directly and executed one at a time?

a)

a) Script Mode

b)

b) Interactive Mode

c)

c) Visual Mode

d)

d) Batch Mode

4.

What is a variable in Python?

a)

a) A fixed value that cannot change

b)

b) A named location in the computer's memory that stores data of a particular type

c)

c) A visual block used to perform an action

d)

d) A tool for designing user interfaces

5.

What does the input() function do in Python?

a)

a) Outputs data to the screen

b)

b) Allows users to enter information into the program

c)

c) Clears all stored data in the program

d)

d) Runs a saved script

6.

What is the purpose of casting in Python?

a)

a) To convert blocks into text

b)

b) To ensure variables are the correct datatype for operations

c)

c) To store multiple types of data in one variable

d)

d) To create new variables automatically

7.

Which of the following is NOT a datatype in Python?

a)

a) String

b)

b) Integer

c)

c) Block

d)

d) Float

8.

What does BIDMAS stand for in Python programming?

a)

a) Binary, Integer, Decimal, Matrix, Addition, Subtraction

b)

b) Brackets, Indices, Division, Multiplication, Addition, Subtraction

c)

c) Bytes, Input, Data, Memory, Allocation, Storage

d)

d) Blocks, Integers, Decimals, Multiplications, Additions, Subtractions

9.

Which link can be used to access online Python for practice?

a)

a) www.python-online.com

b)

b) www.online-phyton.com

c)

c) www.online-python.com

d)

d) www.practice-python.com

10.

What is an example of a common error in Python programming?

a)

a) Using blocks instead of text

b)

b) Misspelling 'Scratch'

c)

c) Incorrect indentation or missing brackets

d)

d) Using the wrong graphics tool

11.

Which feature of Scratch helps prevent syntax errors in programming?

a)

a) Text-based coding

b)

b) Automatic debugging

c)

c) Visual block structure

d)

d) Real-time syntax checking

12.

What is the primary advantage of Python over Scratch?

a)

a) Easier for beginners

b)

b) More flexibility and closer to real-world programming

c)

c) Automatic syntax correction

d)

d) Uses fewer lines of code

13.

Which of the following commands is used to display output on the screen in Python?

a)

a) input()

b)

b) display()

c)

c) print()

d)

d) output()

14.

What is the default datatype of the input captured using the input() function in Python?

a)

a) Integer

b)

b) Float

c)

c) String

d)

d) Boolean

15.

Why is it important to use the correct datatype when performing calculations in Python?

a)

a) To avoid syntax errors

b)

b) To ensure accurate results

c)

c) To reduce the size of the code

d)

d) To make the code run faster

16.

What should you do if a Python program encounters an error due to incorrect datatype casting?

a)

a) Ignore the error and continue

b)

b) Restart the program

c)

c) Correct the datatype using appropriate casting (e.g., int(), float())

d)

d) Use blocks instead of text

17.

Which Python operator is used for multiplication?

a)

a) x

b)

b) *

c)

c) /

d)

d) %

18.

What is the significance of indentation in Python programming?

a)

a) It has no significance.

b)

b) It helps to align code blocks for readability.

c)

c) It is used to define code blocks and control flow.

d)

d) It automatically optimizes the code.

19.

What is the recommended first step when encountering a bug in your Python code?

a)

a) Delete the program and start over.

b)

b) Check for syntax errors and review the code logic.

c)

c) Convert the program to Scratch.

d)

d) Use a different programming language.

20.

What does the acronym BIDMAS help you remember in Python programming?

a)

a) The different types of loops in Python

b)

b) The sequence of datatypes

c)

c) The order of operations in mathematical calculations

d)

d) The order of saving files