Font size
WorksheetsPython Data Structures & Statements
Total questions: 11
Worksheet time: 6mins
list1= [ 1,5]
list1=list1.append(6)
list1
[1,5,6]
[1,6]
None
Error
list1=[1,2,3,4,5]
popped=list1.pop[0]
list1.append(popped)
list1
The Output will be ..........
[2,3,4,5,1]
[1,2,3,4,5]
Error
p='123456789'
p[ : : 7]
18
'17'
19
None of the Above
g= 1<3>2
k= 1<5 and 5 >2
y= g and k
y
True
False
Error
Mohamed Mounir
Strings and lists has a common point both are .....
immutable
mutable
mapping
sequence
Which of the following are true of Python dictionaries:
Items are accessed by their position in a dictionary.
Dictionaries are accessed by key.
Dictionaries can be nested to any depth.
A dictionary can contain any object type except another dictionary.
Dictionaries are mutable.
d = {'foo': 100, 'bar': 200, 'baz': 300}
d['bar':'baz']
(200, 300)
It raises an exception
[200, 300]
200 300
input_list = ['a', 'b', 'c']
','.join(input_list)
'abc'
'a,b,c'
'a','b','c'
'a b c'
6
24
120
5
4
1
2
4
It doesn’t generate any output.
1
2
3
4
black
white
yellow
blue
Done
red
blue
yellow
Done
black
white
blue
Done
black
white
yellow
Done
