Font size
WorksheetsPYTHON ::04
Total questions: 17
Worksheet time: 9mins
What will be the output of the command?
>>> print("hi"*2)
"hi""hi"
hi*2
hihi
2 hi
Mutable sequences can be used as keys in a Dictionary?
True
False
To add an item in the dictionary d we need to do :
d.append('new','value)
d['new']='value'
d.extend('new','value)
d.update('new','value)
Dictionary method __________ returns a list of key-value pairs.
items
keys
value
sizes
>>> str ="hello"+1
output ??
"hello1"
"hello+1"
"hello""1"
Python throws a Type error
Which Built-in types are mutable?
List, strings, Dictionaries , sets
List, strings, Dictionaries , sets , Tuples
List, Dictionaries , sets
List, strings , sets,tuples
>>> name ="snow storm"
>>> name[5]="X"
what gets printed?
snow storm
snowXstorm
snow Xtorm
Python throws an error
Which keyword in Python is used to indicate empty functions,classes and loops ?
pass
break
None
null
Given a function that does not return any value, what value is shown when executed at the shell?
int
bool
pass
None
>>>print 0.1 + 0.2 == 0.3
output??
True
False
error
Machine dependent
Which of the following is not a complex number?
k=2+3j
k=complex(2,3)
k= 2+3J
k=2+3I
What does ~~~~~~5 evaluate to?
note:: ~x is equivalent to -(x+1).
-5
5
11
-11
x = 123
for i in x:
print(i)
1 2 3
3 2 1
1
2
3
error
print(bool('False'))
print(bool())
true, false
true,true
false,true
false,false
कर्मण्येवाधिकारस्ते मा फलेषु कदाचन ।
मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि ॥
write shloka no.(in the format of: 9.26 )
(a)
what are three consideration discussed in the shloka? (multiple correct)
prescribed duties
capricious work
Inaction
Forbidden action
Arjuna was therefore advised by the Lord to fight as a matter of _______________without attachment to the result.
duty
action
fear
love
