NEW
Font size
WorksheetsPCEP Lesson 1 Quiz
Total questions: 10
Worksheet time: 5mins
Which of the following is NOT a data type?
Boolean
Word
Integer
List
Which is the correct way to declare 3 variables, 'a' , 'b', 'c' to 1?
a = b = c = 1
a,b,c = 1
a == b
b == c
c == 1
abc = 1
name = "Magikid Lab"
What will the following code print?
print(name[7])
'k'
' '
'7'
'L'
name = "Magikid Lab"
What snippet of code will print only "Lab"?
print(name[5])
print(name[5:]
print(name[8:])
print(name[Lab])
Which of the following brackets are used for list?
{ }
[ ]
( )
| |
What is the key difference between list and tuples?
List only contain integers and tuples contain strings
List are able to change elements and size where tuples are not.
List hold more values than Tuples
List can only contain strings and Tuples can only contain integers
Which of the following is true about Dictionaries?
Consist of key-value pairs
enclosed with [ ]
Only consist of integers
Only Consist of Strings
Choose the correct answer
print(s1[1:3])
print(s1[1:-3])
print(s1[2])
print(s1[-3])
Which of the following brackets are used for dictionaries?
[ ]
{ }
( )
| |
What is something you wish to learn more about or practice on?
Declaration of different data types
Use of built in functions
Tuples and Dictionaries
Exercises given in class/homework
