WorksheetsPython Question bank
Total questions: 31
Worksheet time: 16mins
………..is simply a set of steps used to complete a specific task.
Coder
Sprite
Algorithm
Coding
How do we make programs in mBlock?
by typing code in Java
By connecting code blocks
By using Python language
By writing scripts
What is it called when we tell the computer what to do step by step?
Coder
Sprite
Algorithm
Coding
How is user input typically read in Python?
Integer
Boolean Value
Text String
Floating Decimal
Which of the following is an assignment operator in Python?
=
>>>
===
==
Which of these codes would return the name "Mona" from the list nameList = ["Ahmed", "Mai", "Hour", "Mona", "Hesham"]?
nameList()
nameList[]
nameList[3]
nameList["3"]
Suppose list1 is [3, 5, 25, 1, 3], what is min(list1)?
3
1
5
25
Suppose list1 is [1, 5, 9], what is sum(list1)?
1
9
15
none
The first index in a Python list is:
1
0
A
a
x.sort() will do what?
Sort the list in ascending order
Sort the list into reverse order
Create a new list
Error
How do I remove something from a list?
x.append()
x.remove()
x.delete()
x=(new variable)
What is used to separate elements in a list?
Bracket
Comma
Full Stop
Space
Which code would I use to add an item to a list?
x.append()
x.sort()
x.add()
Append.x()
_________ is a short form of "else if" statement.
if
else
elif
Else-if
Which of the following commands will return the length of the list mylist?
length(mylist)
len(mylist)
mylist.length()
mylist.len()
Loop That Runs Till Condition is True :
list
while
for
if
Loop That Runs Till Condition is True :
list
while
for
if
Kind of loop used when you know the number of times you want it to repeat.
List
for
while
if
In Python, the two types of loops are _____ and _______.
for
while
list
if
Which character must be at the end of the line for an if statement?
:
{
;
.
Which statement will check to see if a is equal to b?
if a == b
if a = b:
if a == b:
if a != b:
The second part of an if statement, that is executed when the condition is false, is:
if
else
for
input
Pieces of code that only run "under certain conditions" are:
conditional statements
syntax
variables
control flow statements
Which symbol means "not equal to"?
==
!=
>=
<=
If-Else lets you decide between two actions: one if true, another if not.
True
False
In programming, you use conditions to decide what to do next.
True
False
With Python, you can make programs by just moving blocks around.
True
False
Loops help avoid doing the same thing many times by hand in programming.
True
False
In programming, loops are a way to do something over and over again.
True
False
An algorithm is a plan or a series of steps to finish a task.
True
False
A computer program is a list of steps that tell the computer how to finish a job.
True
False
