wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Test

Total questions: 125

Worksheet time: 4hrs 10mins

Name
Class
Date
1.

(a)   created the Python programming language.

Choose from the below words

Guido van Rossum

James Gosling

Dennis Ritchie

Bjarne Stroustrup

2.

In which year was Python first released?

a)

1989

b)

1991

c)

1995

d)

2000

3.

Explain why Python is considered a high-level programming language.

a)

It is written in machine code.

b)

It allows for easy readability and abstraction from machine language.

c)

It is used for low-level hardware programming.

d)

It is only used for web development.

4.

Identify a key feature of Python that contributes to its popularity.

a)

Complex syntax

b)

Strong typing

c)

Dynamic typing

d)

Lack of libraries

5.

Discuss the impact of Python's open-source nature on its development and community.

a)

It limits the number of contributors.

b)

It allows for a large community and rapid development.

c)

It restricts the use of libraries.

d)

It makes Python expensive to use.

6.

Which of the following is a major version of Python that introduced significant changes?

a)

Python 1.0

b)

Python 2.0

c)

Python 3.0

d)

Python 4.0

7.

Match the following descriptions with their significance in Python.

a)

They are used to write Python code.

1.

Python syntax and structure.

b)

They are guidelines and standards for Python's development.

2.

Python Enhancement Proposals (PEPs).

c)

They are Python's error messages.

3.

Python exceptions and tracebacks.

d)

They are Python's built-in functions.

4.

Python standard library utilities.

8.

Analyze how Python's design philosophy emphasizes code readability.

a)

By using complex syntax

b)

By enforcing indentation and clear syntax

c)

By allowing multiple ways to do the same thing

d)

By using verbose error messages

9.

Which of the following is a Python web framework?

a)

Django

b)

React

c)

Angular

d)

Laravel

10.

What is the purpose of Python's Global Interpreter Lock (GIL)?

a)

To speed up Python code execution

b)

To allow multiple threads to execute simultaneously

c)

To prevent multiple native threads from executing Python bytecodes at once

d)

To enhance Python's memory management

11.

Evaluate the role of Python in data science and machine learning.

a)

It is rarely used due to its slow execution speed.

b)

It is a primary language due to its extensive libraries and ease of use.

c)

It is only used for web development.

d)

It is not suitable for data analysis.

12.

Which of the following is a popular Python library for data analysis?

a)

NumPy

b)

jQuery

c)

Bootstrap

d)

Flask

13.

How does Python's interpreted nature affect its performance compared to compiled languages?

a)

It makes Python faster than compiled languages.

b)

It allows Python to run without a compiler, but generally slower.

c)

It requires Python code to be compiled before execution.

d)

It has no effect on performance.

14.

Discuss the advantages and disadvantages of Python's dynamic typing.

a)

It makes code execution faster but harder to read.

b)

It allows flexibility but can lead to runtime errors.

c)

It enforces strict type checking at compile time.

d)

It makes Python unsuitable for web development.

15.

Match the following package managers with their respective programming languages.

a)

npm

1.

JavaScript

b)

pip

2.

Python

c)

gem

3.

Ruby

d)

composer

4.

PHP

16.

Around 3000 BC, the most primitive form of computation was done on a(n):

a)

abacus

b)

adding machine

c)

mechanical computer

d)

none of the above

17.

How many generations of computer history are there?

a)

3

b)

4

c)

5

d)

6

18.

This machine was built as a partnership between IBM and Harvard.

a)

Harvard Mark 1

b)

Zuse Z3

c)

Babbage's Analytic Engine

d)

TRADIC

19.

Many early computers were big enough to fill a whole room and weighed thousands of pounds.

a)

TRUE

b)

FALSE

20.

Who was known for building the first programmable mechanical computer in the year 1820?

a)

Charles Darwin

b)

Charles Babbage

c)

Blaise Pascal

d)

Herman Hollerith

21.

Grace Hopper gave this name to fixing errors in computer code?

a)

Stooking

b)

Blogging

c)

Fixometrics

d)

Debugging

22.

Most early computers where used

a)

for social media

b)

for online shopping

c)

for military and scientific calculations

d)

for video streaming

23.

This machine was the first mechanical calculator. It was made with a series of gears and wheels

a)

Abacus

b)

Pascaline

c)

ENIAC

d)

Analytical Engine

24.

This device improved on Pascal's invention by using fluted drums instead of gears

a)

Leibniz's Stepped Reckoner

b)

Babbage's Analytical Engine

c)

Hollerith's Tabulating Machine

d)

Turing's Bombe

25.

The First Generation computers used

a)

Transistors

b)

Integrated Circuits

c)

Vacuum Tubes

d)

Microprocessors

26.

First Generation computers were

a)

slow, huge, and expensive

b)

slow, small, inexpensive

c)

Based on Integrated Circuits

d)

Based on Microprocessors

27.

What were used in Second Generation computers?

a)

Vacuum Tubes

b)

Transistors

c)

Integrated Circuits

d)

Microprocessors

28.

In Second Generation computers, which programming language were used?

a)

Java

b)

Python

c)

Assembly Language (COBOL and FORTRAN)

d)

C++

29.

What were used in Third Generation computers?

a)

Vacuum Tubes

b)

Transistors

c)

Integrated Circuits

d)

Mechanical parts

30.

Due to the increase of power and reduction of size, Third Generation computers

a)

became less expensive

b)

were slower than First Generation

c)

were more expensive

d)

never worked

31.

Fourth Generation computers used

a)

Vacuum Tubes

b)

Transistors

c)

Abacus

d)

VLSI (Very Large Scale Integrated) circuits

32.

Fourth Generation computers used what type of programming languages?

a)

Assembly language

b)

Machine language

c)

C and C++

d)

Punch cards

33.

Fifth Generation computers use

a)

Vacuum Tubes

b)

Transistors

c)

Punch cards

d)

ULSI (Ultra Large Scale Integration)

34.

Fifth Generation computers also use

a)

Artificial Intelligence software

b)

Vacuum Tubes

c)

Transistors

d)

Integrated Circuits

35.

Why was Alan Turing important to computer science?

a)

He invented the internet

b)

He was a famous video game designer

c)

He was a pioneer in artificial intelligence

d)

He is considered the father of modern computing and artificial intelligence, and during World War II, he developed a machine that helped break the German Enigma code

36.

Who is often regarded as the "Father of the Computer" for his work on the concept of a programmable machine in the early 19th century?

a)

Thomas Edison

b)

Charles Babbage

c)

Steve Jobs

d)

Alan Turing

37.

In which decade did the first electronic digital computer, known as the ENIAC, become operational?

a)

1920s

b)

1930s

c)

1940s

d)

1950s

38.

What is the name of the programming language developed in the 1950s and considered one of the earliest high-level languages used for scientific and engineering applications?

a)

FORTRAN

b)

COBOL

c)

BASIC

d)

Pascal

39.

Which company introduced the Apple I, one of the first successful personal computers, in the mid-1970s?

a)

IBM

b)

Apple Inc.

c)

Microsoft

d)

Commodore

40.

What significant development in the 1980s revolutionized personal computing by providing a user-friendly interface?

a)

The Internet

b)

The graphical user interface (GUI)

c)

The microprocessor

d)

Artificial intelligence

41.

Which event came first?

a)

First cell phones available for sale

b)

World Wide Web invented

c)

Google is formed

42.

Which event came first?

a)

First e-mail is sent

b)

Apple is founded

c)

Mobile phone invented

43.

Which event came first?

a)

Personal computer created

b)

Microsoft is founded

c)

Mobile phone invented

44.

Which event came first?

a)

PayPal is created

b)

YouTube is created

c)

Virtual Reality available to public

45.

Which event happened first?

a)

Charles Babbage plans a calculating machine

b)

Alexander Graham Bell invents the telephone

c)

Samuel Morse invents the telegraph

46.

Which event happened first?

a)

First cell phones are available for sale

b)

The personal computer is created

c)

Marty Cooper invents the mobile phone

47.

Which event happened first?

a)

Google is formed

b)

Microsoft is founded

c)

Tim Berners-Lee invents the World Wide Web

d)

Apple creates the first computer with a GUI

48.

Which event happened first?

a)

The first web browser program is created

b)

First e-mail messages are sent

c)

PayPal is created

d)

IBM releases the IBM personal computer

49.

The first computer was the

a)

abacus.

b)

Macintosh.

c)

IBM.

d)

Difference Engine.

50.

The abacus was made of

a)

beads.

b)

bones.

c)

sticks.

51.

(a)   is known as the father of modern computers.

52.

Herman Hollerith invented the _____.

a)

punched card system

b)

integrated circuit

c)

transistor

d)

vacuum tube

53.

Match the following computers with their generation.

a)

2nd

1.

IBM 7090

b)

3rd

2.

IBM System/360

c)

1st

3.

ENIAC

d)

4th

4.

Apple Macintosh

54.

Pascal's computer concept is still used today in _____ (Choose 3)

a)

odometers

b)

water meters

c)

speedometers

d)

integrated circuits

e)

transistors

55.

Match the major development with its corresponding generation.​

a)

1st generation

1.

vacuum tubes

b)

2nd generation

2.

transistors

c)

3rd generation

3.

integrated circuit

d)

4th generation

4.

microchip

e)

5th generation

5.

AI

56.

True of False? Gottfried Leibniz's computer could only add.

a)

true

b)

false

57.

What is finding and fixing errors in programs?

a)

Debugging

b)

Program

c)

Bug

d)

Code

58.

What is an error in a program that prevents the program from running as expected?

a)

Algorithm

b)

Program

c)

Bug

d)

Code

59.
Question Image

Match the following descriptions with their definitions.

a)

Rules of conduct.

1.

Code of ethics.

b)

A pack between friends.

2.

Friendship agreement.

c)

One or more commands designed to be carried out by a computer.

3.

Computer programming instructions.

d)

Edoc spelled backwards.

4.

Reverse of 'code'.

60.

What do we call the person who writes the instructions for the computer to complete a task?

a)

architect

b)

programmer

c)

Bob

d)

composer

61.

What is the primary purpose of a for loop in Python as described in the text?

a)

To execute a block of code a limited number of times based on a condition

b)

To generate random numbers

c)

To define functions

d)

To import libraries

62.

Which Python function is used to generate a sequence of numbers in the provided example?

a)

list()

b)

dict()

c)

range()

d)

set()

63.

According to the example, what does the expression 'num ** 2' in the for loop calculate?

a)

The square root of num

b)

The cube of num

c)

The square of num

d)

The logarithm of num

64.

What is the purpose of using the ** operator in the provided Python code snippet?

a)

To perform addition

b)

To perform subtraction

c)

To calculate the square of a number

d)

To divide one number by another

65.

What will be the output of the code when num is 5?

a)

The square of 5 is 25

b)

The square of 5 is 5

c)

The square of 5 is 10

d)

The square of 5 is 30

66.

Which Python function is used to generate a sequence of numbers in the code?

a)

list()

b)

dict()

c)

range()

d)

str()

67.

What is the primary benefit of using loops in programming, as described in the text?

a)

To make the code shorter and more readable

b)

To perform calculations faster

c)

To automate repetitive tasks and process collections of data

d)

To reduce the number of variables needed

68.

What will the program print if the player's choice is "Rock" and the computer's choice is "Scissors"?

a)

It's a tie!

b)

You win! Rock beats Scissors

c)

Computer wins!

d)

You win! Paper beats Rock

69.

What is the correct way to generate a random choice for the computer in this Python program?

a)

computer_choice = random.choice([0,1,2])

b)

computer_choice = random.select("Rock", "Paper", "Scissors")

c)

computer_choice = choose(["Rock", "Paper", "Scissors"])

d)

computer_choice = random.randint(0, 2)

70.

If both the player and the computer choose "Paper", what will the output of the program be?

a)

You win! Paper beats Rock

b)

Computer wins!

c)

It's a tie!

d)

You win! Rock beats Scissors

71.
To repeat until a particular condition is true use
a)
while loop
b)
for loop
c)
if loop
d)
indentation
72.

Loop that runs till the condition is true

a)

list

b)

while

c)

for

d)

if

73.
Which of the following symbols is used in Python to mean "Not equal to"?
a)
==
b)
!=
c)
<>
d)
><
74.
A function;
a)
Expresses a true false statement
b)
can contain letters, numbers, spaces, and symbols.
c)
takes in an input, does something with it, and then returns an output.
d)
Runs a boolean (true/false) statement based on data entered
75.

The ​ (a)   function assigns a random ​ (b)   to a ​ (c)   . You can pick the ​ (d)   of numbers which the program can ​ (e)   from. 

Choose from the below words
random
number
variable
range
pick
76.

What will be the output of the following Python code snippet?

print(8 ** 2)

a)

64

b)

16

c)

8

d)

None of the above

77.

What does the expression 'num ** 3' calculate in Python?

a)

The square of num

b)

The cube of num

c)

The square root of num

d)

The triple of num

78.

If the player chooses 'Scissors' and the computer chooses 'Paper', what will the output of the game be?

a)

It's a tie!

b)

You win! Scissors beat Paper

c)

Computer wins!

d)

You win! Paper beats Rock

79.

The transistor replaced the __________?

a)

Analytical Engine

b)

Microchip

c)

Vacuum Tube

d)

Solid State Memory

80.

What is flow control?

a)

Reacting to the results of a computation

b)

Method for getting rid of bad input data

c)

Used to make vacuum tubes

d)

Guidance system for the Apollo program

81.

What was the earliest programming language?

a)

Python

b)

BASIC

c)

Assembly

d)

Machine Code

82.

An algorithm is:

a)

One packet of data sent from one part of the computer to another

b)

A series of fixed steps used to complete a specific process

c)

The way punch cards were punched

d)

The core processor for the first personal computer

83.

Who was the first computer programmer?

a)

Charles Babbage

b)

Herman Hollerith

c)

Balise Pascal

d)

Ada Lovelace

84.

Newer generations of programming language tend to be:

a)

More readable by humans

b)

Less readable by humans

c)

Easier for computers to run

d)

More expensive

85.

WYSIWYG changed text documents by:

a)

Making the display view the same as the printed version

b)

Making the person writing the document insert markup tags.

c)

Requiring the MLA format

d)

Making different font sizes available

86.

The 4 steps of computing are:

a)

science, technology, engineering, math

b)

input, process, output, store

c)

state hypothesis, collect data, test, and conclude

d)

prophase, metaphase, anaphase, telophase

87.

Identify this computer component:

a)

Transistor

b)

Integrated Circuit (IC)

c)

Microprocessor

d)

Vacuum Tube

88.

What replaced transistors in the 1960's

a)

UNIVAC

b)

Cobol

c)

Integrated Circuts

d)

ENIAC

89.

What was the idea that computing power would double every two years?

a)

Maxwell's Law

b)

Planck's Constant

c)

Rule of Two

d)

Moore's Law

90.

What was the biggest difference between Arpanet and the World Wide Web?

a)

HTML

b)

HTTPS

c)

FTP

d)

TCP/IP

91.

This addition to computers allowed users to click on pictures to execute commands

a)

ALU

b)

CPU

c)

GUI

d)

PCI

92.

What are some advantages of digital signals over analog signals. (Select all that apply)

a)

More likely to be affected by small disturbances

b)

Less likely to be affected by small disturbances

c)

Easier to design circuits when using only two states

d)

Harder to design circuits when using only two states

93.

"Black-boxed" is a term for

a)

Anytime the decision making process is hidden

b)

Rush shipping from Amazon

c)

Putting carbon fibers around electronics to prevent data loss

d)

The power source for a computer

94.

What were the three components in John von Neumann's architecture?

a)

Input/Output

b)

CPU

c)

Graphics

d)

Memory

95.

Around 3000 BC, the most primitive form of computation was done on a(n):

a)

abacus

b)

adding machine

c)

mechanical computer

d)

none of the above

96.

How many generations of computer history are there?

a)

3

b)

4

c)

5

d)

6

97.

This machine was built as a partnership between IBM and Harvard.

a)

Harvard Mark 1

b)

Zuse Z3

c)

Babbage's Analytic Engine

d)

TRADIC

98.

Many early computers were big enough to fill a whole room and weighed thousands of pounds.

a)

TRUE

b)

FALSE

99.

Who was known for building the first programmable mechanical computer in the year 1820?

a)

Charles Darwin

b)

Charles Babbage

c)

Blaise Pascal

d)

Herman Hollerith

100.

Grace Hopper gave this name to fixing errors in computer code?

a)

Stooking

b)

Blogging

c)

Fixometrics

d)

Debugging

101.

Most early computers where used

a)
for social media
b)
for online shopping
c)
for military and scientific calculations
d)
for video streaming
102.

This machine was the first mechanical calculator. It was made with a series of gears and wheels

a)
Abacus
b)

Pascaline

c)
ENIAC
d)
Analytical Engine
103.

This device improved on Pascal's invention by using fluted drums instead of gears

a)
Leibniz's Stepped Reckoner
b)
Babbage's Analytical Engine
c)
Hollerith's Tabulating Machine
d)
Turing's Bombe
104.

The First Generation computers used

a)
Transistors
b)
Integrated Circuits
c)
Vacuum Tubes
d)
Microprocessors
105.

First Generation computers were

a)

slow, huge, and expensive

b)

slow, small, inexpensive

c)
Based on Integrated Circuits
d)
Based on Microprocessors
106.

What were used in Second Generation computers?

a)
Vacuum Tubes
b)
Transistors
c)
Integrated Circuits
d)
Microprocessors
107.

In Second Generation computers, which programming language were used?

a)
Java
b)
Python
c)

Assembly Language (COBOL and FORTRAN)

d)
C++
108.

What were used in Third Generation computers?

a)
Vacuum Tubes
b)
Transistors
c)
Integrated Circuits
d)
Mechanical parts
109.

Quiz: What is a  string?

a)

A variable that stores multiple values.

b)

A variable that stores 1 value.

c)

A function that outputs words/numbers.

d)

A function that asks user input.

110.

How do you create words in Python?

a)

Using the if then function

b)

Using a variable

c)

Using the import function

d)

Using the print function

111.

Quiz: What is a  variable?

a)

A function that inputs a module.

b)

A variable that stores 1 value.

c)

A function that outputs words/numbers.

d)

A function that asks user input.

112.

Why was Python (TM) developed?

a)

To go back to the old way of programming

b)

To create a programming language for students in grade school

c)

To make it easier to learn Java

d)

Python was developed by accident

113.

Python (TM) is owned and managed by

a)

Microsoft (c)

b)

Sun Microsystems (c)

c)

Python (TM) is open source and free to use

d)

Google (c)

114.

Python is ___________ level programming language and is ___________.

a)

High, compiled

b)

High, interpreted

c)

Low, compiled

d)

Low, interpreted

115.

Generally speaking, a low level programming language is easier to read, write and maintain over a high level programming language

a)

True

b)

False

116.

The syntax in Python (TM) is one of the main advantages over other high level programming languages.

a)

True

b)

False

117.

A statement in programming

a)

Expresses an action to be carried out

b)

Always returns results like expressions

c)

Rules controlling how components in a program are combined

d)

An instruction to perform a task, usually one word

118.

A string

a)

carries out an action

b)

the elements of a command

c)

a collection of characters

d)

how elements in a commad are arranged

119.

A block is

a)

a statement including elements of a command

b)

the structure and form of the code

c)

source code that is grouped together

d)

meaning assigned to symbols, characters and words

120.

What symbol comes before a comment?

a)

$

b)

>>

c)

#

d)

!

121.

An exception is

a)

the structure of form of the code

b)

the meaning of the characters and words in the code

c)

the statement that is missing from the instructions

d)

an event occurring during execution of a program which disrupts the flow of the program's instructions

122.

Debugging is

a)

how characters are arranged in a statement

b)

detecting or removing errors from a program

c)

removing viruses from a computer

d)

the meaning of each of the characters and symbols in the program

123.

A disadvantage of Python is it is harder to debug than other higher level programming languages.

a)

True

b)

False

124.

In programming, a (n) _______________ is a value that can change, depending on conditions or on information passed to the program

a)

string

b)

block

c)

instruction

d)

variable

125.

Generally speaking Python (TM) would run _____________ than C++ and take ____________ time to create

a)

faster, less

b)

faster, more

c)

slower, less

d)

slower, more