Font size
Worksheetsgrade 8
Total questions: 80
Worksheet time: 1hrs 6mins
is integer a number
true
false
chose which is a floating point
14
15.5
chose a string
"tim"
"tim
'tim'
"tim
tim
in python does it matter if we type ' and " together
true
false
in python does i t matter if we right "and" this together and 'and' together
true
false
is boolean a data type or a condition
data type only
data type and condition only
condition only
where is python used
web aplications
data science
mobile apps
GUI applications
is boolean true or false
true only
false only
true and false only
Quel est le type de a : a="33"
Integer
Float
String
Boolean
Quel est le type de a : a=33
Integer
Float
String
Boolean
Quel est le type de a : a=33.0
Integer
Float
String
Boolean
b + a
Salut
lutSa
ERROR
48
48.0
ERROR
12*4
48.0
ERROR
48
12*4.0
5
32
ERROR
3 + "2"
60
23
35
27
a
4
3
b
Majeur
Rien
Mineur
ERROR
Python is a
text language
database language
programming language
Python has a simple syntax similar to the
coding language
english language
spanish language
Code for Hello, World!
print Hello, World!
print("Hello, World!)
print("Hello, World!")
Insert the missing part of the code below to output
_________________ "My name is ".
Python language use
upper case letters
lower case letters
upper and lower case letters
The output of the program
x = 4
x = "Sally"
print(x)
four
Saly
Sally
The punctuation requirements for printing a string in Python are:
( ) , ! and " "
( ) and !
( ) and " "
" " and !
It displays an output
print(3+4)
Print("Hello world!")
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
Which of these codes is correct for creating a list of numbers?
num = ('10','29','37','109')
num = ['10','29','37','109']
num == ('10','29','37','109')
num = ['10 29 37 109']
What is the index number for 'Spain'?
['England','Brazil','Spain','France']
0
1
2
3
What is used to separate elements in a list?
Bracket
Comma
Full Stop
Space
What brackets are used to create a list?
()
[]
What does the '#' allow you to do?
Repeat code
Comment on code
Print code
End code
Which of these operators means EQUAL TO?
'='
'=>'
'<='
'=='
List items have an index number. In the following list, which item has the index number of 3?
["John", "Harry", "Jesse", "John", "Harry", "Harry"]
"John"
"Harry"
"Jesse"
Which of these is the correct code for creating a list of names?
nameList = John, Harry, Jesse, John, Harry, Harry
nameList = ("John", "Harry", "Jesse", "John", "Harry", "Harry")
nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
nameList = [John, Harry, Jesse, John, Harry, Harry]
Is this the correct code for a list?
register = {"Sam", "Pheobe", Georgia", Richard"}
Yes
No
What is the index of “grape” in the list
[“apple”, “grape”, “orange”, “watermelon”]?
0
1
2
3
What is the output of program below?
bicycles = ['trek', 'cannondale', 'redline', 'specialized']
print(bicycles[-1])
trek
cannondale
redline
specialized
Which of these is the correct code for creating a list of names?
nameList = John, Harry, Jesse, John, Harry, Harry
nameList = ("John", "Harry", "Jesse", "John", "Harry", "Harry")
nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
nameList = [John, Harry, Jesse, John, Harry, Harry]
List items have an index number. In the following list, which item has the index number of 3?
["John", "Harry", "Jesse", "John", "Harry", "Harry"]
"John"
"Harry"
"Jesse"
Which of these pieces of code would return the name "Harry" from the following list?
nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
nameList()
nameList[1]
NameList(4)
nameList["4"]
Which of these is a list?
fruit = ["pineapples", "mangoes", "bananas"]
fruit = "pineapples", "mangoes", "bananas"
fruit = {"pineapples", "mangoes", "bananas"}
fruit = ("pineapples", "mangoes", "bananas")
If you want to create an empty list called islands, which of the following pieces of code is correct?
islands = { }
islands = ( )
islands = [ ]
islands = < >
Each item in a list has an "address" or index. The first index in a Python list is what?
1
0
a
A
What is the index of the name 'Paula' in the following list:
names = ["Paul","Phillip","Paula","Phillipa"]
0
1
2
3
What is the output of program below?
mariana_islands = ['Guam', 'Saipan', 'Tinian', 'Rota']
print(mariana_islands[-1])
Guam
Saipan
Tinian
Rota
What is the output of program below?
mariana_islands = ['Saipan', 'Tinian', 'Rota']
mariana_islands[0] = 'Guam'
print(mariana_islands)
['Saipan', 'Tinian', 'Rota']
['Guam', 'Tinian', 'Rota']
['Saipan', 'Tinian', 'Rota', 'Guam']
['Guam', 'Saipan', 'Tinian', 'Rota']
What is the output of program below?
mariana_islands = ['Guam', 'Saipan', 'Tinian', 'Rota']
print(mariana_islands[1])
Guam
Saipan
Tinian
Rota
What is the output of the program below?
mariana_islands = ['Guam', 'Saipan', 'Tinian', 'Rota']
cmni = mariana_islands[1:]
len(cmni)
1
2
3
4
Which of these is the correct code for creating a list of names?
nameList = John, Harry, Jesse, John, Harry, Harry
nameList = ("John", "Harry", "Jesse", "John", "Harry", "Harry")
nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
nameList = [John, Harry, Jesse, John, Harry, Harry]
List items have an index number. In the following list, which item has the index number of 3?
["John", "Harry", "Jesse", "John", "Harry", "Harry"]
"John"
"Harry"
"Jesse"
Which of these pieces of code would return the name "Harry" from the following list?
nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
nameList()
nameList[1]
NameList(4)
nameList["4"]
The list needs one more name added to the end - "Felipe". Which piece of code below would do this?
nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
nameList.append(Felipe)
append(nameList,"Felipe")
nameList.append["Felipe",7]
nameList.append("Felipe")
What would this code show on the screen?
7
6
5
4
An error
What would this code show in the shell?
3
2
1
0
An error
The list needs one more name added to the end - "Felipe". Which piece of code below would do this?
nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
nameList.append(Felipe)
append(nameList,"Felipe")
nameList.append["Felipe",7]
nameList.append("Felipe")
What is the output of program below?
bicycles = ['trek', 'cannondale', 'redline', 'specialized']
print(bicycles[-1])
trek
cannondale
redline
specialized
Which method is used to add a value at a specified position in the list?
append
extend
insert
pop
Which symbols are used to open and close a list?
( ) round brackets
( ) curly brackets
[ ] square brackets
" " speech marks
To add an item to the end of a list we use
fruit.add("strawberries")
fruit.append("strawberries")
append(fruit("strawberries")
("strawberries").append[fruit]
To insert an item in the first position of a list we use
fruit.append("strawberries, 1")
fruit.insert("strawberries",0)
fruit.insert(1, "strawberries")
fruit.insert(0, "strawberries")
List items have an index number. In the following list, which item has the index number of 3?
["John", "Harry", "Jesse", "John", "Harry", "Harry"]
"John"
"Harry"
"Jesse"
Which of these pieces of code would return the name "Harry" from the following list?
nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
nameList()
nameList[1]
NameList(4)
nameList["4"]
The list needs one more name added to the end - "Felipe". Which piece of code below would do this?
nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
nameList.append(Felipe)
append(nameList,"Felipe")
nameList.append["Felipe",7]
nameList.append("Felipe")
Is this the correct code for a list?
register = {"Sam", "Pheobe", Georgia", Richard"}
Yes
No
