(a)True or false a=[1,2,[3,4],[5,6],7] (i) 3 in a (ii)[1,2,8,9]<[9,1] (iii)[1,2,3]==[1.0,2.0,3.0] python
Answers
Answered by
0
Answer:
a) False
Every element of list has different identity and sub list is also different ; 3 and [3,4] is differently defined
b) True
The comparison in python goes lexicographically i.e how comparison between words are done .
It means which word would be placed before in dictionary
Compare teeth and tenth
t equals t
e equals e
but now e of teeth of e is smaller than n of tenth so teeth is placed before
similarly here, 9 of [9,1] is greater than 1 of [1,2,8,9] and so [9,1] is greater than [1,2,8,9] no matter what is next value
change values and try on your own
c)True
Python compares integer even by converting them into floating values and that makes them equal
Explanation:
Hope it helps :-)
Similar questions