NEW
Font size
WorksheetsAI Beginners level 3
Total questions: 10
Worksheet time: 5mins
Which one is correct for giving [5] as output in list [1,2,3,4,5]?
[4:]
[-1:]
Both
None
Which one is correct for giving [3] as output in list [1,2,3,4,5]?
[0]
[1]
[2]
[3]
Can positive indexing be used on tuples?
How to define a function with variable arguments
def myfunc()
def myfunc:
def myfunc(*args)
def myfunc(x,y)
Can lists be manipulated?
yes
no
sometimes
none
Which functions can be performed on dictionary
Add
Delete
Replace
All
Which one of following is known as Higher Order Function
map
filter
lambda
both map & filter
Tick the correct syntax to update key values in dictionary:-
Dictionary[‘key’] = value
Dictionary.update({‘key’:value})
Both
None
A list, tuple, dictionary are enclosed in
( ),[ ],{ }
[ ], { }, ( )
[ ], ( ), { }
None
What is output of following code:
def function_name(firstname, lastname):
return lastname,firstname
function_name('John','Keats')
John Keats
Keats John
Both
None
