NEW
Font size
WorksheetsPP-ASSESSMENT-1
Total questions: 20
Worksheet time: 16mins
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]
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")
Which kind of loop would be used?
I need a program that will keep letting me add money to a piggy bank until I get to £100.
FOR Loop
WHILE Loop
Find the Output:
Item = {"ECE" , "CSE" , "EEE" , "CIVIL"}
Item.add (2,"MECH")
print(Item)
{ "ECE" , "MECH" , "CSE" , "EEE" , "CIVIL" }
{ "ECE" , "CSE" , "MECH" , "EEE" , "CIVIL" }
{ "ECE" , "CSE" , "EEE" , "CIVIL" }
{ "ECE" , "CSE" , "EEE" ,"MECH" , "CIVIL" }
print("Hello" + str(2) + "world!")
print(9/3*2+4-5)
Look at this code, which of these is a variable?
input
4
int
mylength
What will the output be from the following code?
print(3+4)
3+4
7
SyntaxError
print(3+4)
What would this print?
What will the output be from the following Python code?
print(9/3)
3
3.0
9/3
SyntaxError
Which of these is correct Python conditional statement?
IF answer == "Yes":
if answer == "Yes"
if answer == "Yes":
if answer = "yes":
What will this code do?
Print Numbers 1-11
Print Numbers 1-10
Print Numbers 2-10
Print Error
What will be the output of this code?
0,2,4,6,8
0,2,4,6,8,10
2,4,6,8,10,12
0,2,4,6,8,10,12
