WorksheetsPython Quiz
Total questions: 6
Worksheet time: 4mins
Square brackets in an assignment statement will create which type of data structure?
( s=[] )
List
Dictionary
Tuple
Set
What is the output of the following code?
str="pynative"
print(str[1:3])
py
yn
yna
pyn
Select which true for Python function ( 2 answers)
A function is a code block that only executes when called and always returns a value.
A function only executes when it is called and we can reuse it in a program
Python doesn’t support nested function
Select true statements regarding the Python tuple
We cannot remove the item from tuple and we cannot update items of the tuple
We cannot delete the tuple
We cannot remove the items from the tuple
We can remove the item from tuple and we cannot update items of the tuple
To use a module in another module, you must import it using an _______ statement.
import
for
while
Comparing a dictionary to Python to a dictionary for words, ____________ is each word we look up_______ is definition of the word
value, key
method, value
key, attribute
key, value
