wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Midterm revision for grade 6

Total questions: 46

Worksheet time: 40mins

Name
Class
Date
1.

What is a variable in Python?

a)

A variable in Python is a type of function.

b)

A variable in Python is a fixed value that cannot change.

c)

A variable in Python is a command used to execute code.

d)

A variable in Python is a named reference to a value stored in memory.

2.

Which of the following is a valid data type in Python: int, float, or both?

a)

both

b)

list

c)

boolean

d)

string

3.

How do you create a variable named 'age' and assign it the value 12?

a)

age = 12

b)

age := 12

c)

var age = '12'

d)

let age = 12;

4.

How do you take input from a user in Python?

a)

Use the 'input()' function to take input from a user.

b)

Use the 'scan()' function to take input from a user.

c)

Use the 'get_input()' function to take input from a user.

d)

Use the 'read()' function to take input from a user.

5.

What will be the output of print('Hello, ' + 'World!')?

a)

Hello, World

b)

Hello, 'World!'

c)

Hello, World!

d)

Hello World!

6.

What is the purpose of the input() function in Python?

a)

To take input from the user.

b)

To output data to the user.

c)

To define a function in Python.

d)

To read files from the system.

7.

What is an error in programming?

a)

An error in programming is a feature that enhances functionality.

b)

An error in programming is a successful execution of code.

c)

An error in programming is a mistake in the code that causes it to behave unexpectedly or fail.

d)

An error in programming is a type of programming language.

8.

What is the output of print('5' + '5')?

a)

55.0

b)

55

c)

10

d)

55 + 0

9.

aspects of computing device that you can't touch

(a)  

10.

the software that runs the hardware and software

(a)  

11.

the software that manages the hardware and the software

(a)  

12.

the way the users and computers communicate

(a)  

13.

The aspects of computing device that you can touch

(a)  

14.

applications for general or specific tasks

(a)  

15.

tasks that are carried out by the user to a digital system

(a)  

16.

an electronic device that can help the user complete tasks such as switching on appliances.

(a)  

17.

computers that can mimic the way humans think and make decisions

(a)  

18.

unwanted emails

(a)  

19.

a computer program that detects junk mails and removes it from emails.

(a)  

20.

a character in the background of a computer game that the players can interact with

(a)  

21.

computers identifying similarities in lines, colours, textures and shapes of an image in an attempt to identify objects.

(a)  

22.

when task is carried out automatically without human intervention

(a)  

23.

deceiving someone for financial or personal gain

(a)  

24.

software that simulates a human-like conversation via text message

(a)  

25.

the process of creating something

(a)  

26.

a file that contains data in a text format only

(a)  

27.

a pattern that shows behaviour or data moving in a general direction

(a)  

28.

a text file that holds small pieces of data about a user

(a)  

29.

a text entered by a programmer to improve readability

(a)  

30.

another word for running a program

(a)  

31.

Python's text editor that allows programmers to enter a list of commands and they are executed together

(a)  

32.

Which of the following is used to define a function in Python?

a)

def

b)

function

c)

method

d)

define

33.

Which of the following statements is used to exit a loop in Python?

a)

exit

b)

break

c)

stop

d)

return

34.

What is the output of the expression 3 * 'Hello'?

a)

HelloHelloHello

b)

3Hello

c)

Hello3

d)

Error

35.

What is the purpose of the 'def' keyword in Python?

a)

To define a function

b)

To declare a variable

c)

To create a loop

d)

To import a module

36.

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

a)

# This is a comment

b)

// This is a comment

c)

/* This is a comment */

d)

-- This is a comment

37.

What is the shape for process

(a)  

38.

what is the shape for start/stop

(a)  

39.

"175.6" what data type was used in this example?

(a)  

40.

kg = 80

in the example given, the variable kg is holding what type of data?

(a)  

41.

num1 = int(input("give me a number"))

in the code above, we can also cast what kind of data type?

(a)  

42.

num1=int(input("give me a number")

in the given code above, what is missing?

(a)  

43.

print (hello)

in the given code above, what is missing?

(a)  

44.

name=input("enter your name)

print("hello", Name)

in the given code above, what is wrong??

(a)  

45.

print("let's do addition")

num1=str(input("give me a number")

total = num1 + num1

in the given code above, What do we call the proper use of the correct data type in a line of code?

(a)  

46.

name = "anna"

if name == "john"

print ("hi", name)

else

print("stranger danger")

with the given code, what is missing in the if-else statement?

(a)