Font size
WorksheetsMidterm revision for grade 6
Total questions: 46
Worksheet time: 40mins
What is a variable in Python?
A variable in Python is a type of function.
A variable in Python is a fixed value that cannot change.
A variable in Python is a command used to execute code.
A variable in Python is a named reference to a value stored in memory.
Which of the following is a valid data type in Python: int, float, or both?
both
list
boolean
string
How do you create a variable named 'age' and assign it the value 12?
age = 12
age := 12
var age = '12'
let age = 12;
How do you take input from a user in Python?
Use the 'input()' function to take input from a user.
Use the 'scan()' function to take input from a user.
Use the 'get_input()' function to take input from a user.
Use the 'read()' function to take input from a user.
What will be the output of print('Hello, ' + 'World!')?
Hello, World
Hello, 'World!'
Hello, World!
Hello World!
What is the purpose of the input() function in Python?
To take input from the user.
To output data to the user.
To define a function in Python.
To read files from the system.
What is an error in programming?
An error in programming is a feature that enhances functionality.
An error in programming is a successful execution of code.
An error in programming is a mistake in the code that causes it to behave unexpectedly or fail.
An error in programming is a type of programming language.
What is the output of print('5' + '5')?
55.0
55
10
55 + 0
aspects of computing device that you can't touch
(a)
the software that runs the hardware and software
(a)
the software that manages the hardware and the software
(a)
the way the users and computers communicate
(a)
The aspects of computing device that you can touch
(a)
applications for general or specific tasks
(a)
tasks that are carried out by the user to a digital system
(a)
an electronic device that can help the user complete tasks such as switching on appliances.
(a)
computers that can mimic the way humans think and make decisions
(a)
unwanted emails
(a)
a computer program that detects junk mails and removes it from emails.
(a)
a character in the background of a computer game that the players can interact with
(a)
computers identifying similarities in lines, colours, textures and shapes of an image in an attempt to identify objects.
(a)
when task is carried out automatically without human intervention
(a)
deceiving someone for financial or personal gain
(a)
software that simulates a human-like conversation via text message
(a)
the process of creating something
(a)
a file that contains data in a text format only
(a)
a pattern that shows behaviour or data moving in a general direction
(a)
a text file that holds small pieces of data about a user
(a)
a text entered by a programmer to improve readability
(a)
another word for running a program
(a)
Python's text editor that allows programmers to enter a list of commands and they are executed together
(a)
Which of the following is used to define a function in Python?
def
function
method
define
Which of the following statements is used to exit a loop in Python?
exit
break
stop
return
What is the output of the expression 3 * 'Hello'?
HelloHelloHello
3Hello
Hello3
Error
What is the purpose of the 'def' keyword in Python?
To define a function
To declare a variable
To create a loop
To import a module
Which of the following is a valid way to comment in Python?
# This is a comment
// This is a comment
/* This is a comment */
-- This is a comment
What is the shape for process
(a)
what is the shape for start/stop
(a)
"175.6" what data type was used in this example?
(a)
kg = 80
in the example given, the variable kg is holding what type of data?
(a)
num1 = int(input("give me a number"))
in the code above, we can also cast what kind of data type?
(a)
num1=int(input("give me a number")
in the given code above, what is missing?
(a)
print (hello)
in the given code above, what is missing?
(a)
name=input("enter your name)
print("hello", Name)
in the given code above, what is wrong??
(a)
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)
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)
