Python Assignment - 2
Python Assignment - 2
3. What is a List? What is the data type of list? Create one list?
6. What is dictionary? What is the data type of it? Create one dictionary?
9. What are the starting index numbers for both forward and backward indexing?
j. Copy the same string into other new strings like str1,str2 and str3 at a time
e. How to add both complex number 1+2j and float value 1.3 to the above list.
f. How to add bool value ‘True’ between 10 and 20 in the above list?
g. How to remove the str value ‘Python’ from the above list?
15. What are the differences between append() and extend() in list?
24. Can we add new element to the existing set? How can we add?
25. Can we add new elements to the frozenset? If no, give one example?
PYTHON ASSIGNMENT - 2
4. What intersection_update?and perform between se1 and se2 and vice versa.
5. What is difference_update?and perform between se1 and se2 and vice versa.
6. What is symmetric_difference? Perform between se1 and se2 and vice versa.
29. What is the result of isdisjoint() if one set contains elements and other set is empty?
30. What is the difference between ‘=’ and ‘==’? explain with one example?
PYTHON ASSIGNMENT - 2
31. How to check whether the specific element is existed or not in the given list?
Example?
b. se1!=se2
c. se1<=se2
d. se1<se2
e. se2>se1
f. se1.isdisjoint(se2)
b. s1<=s2
PYTHON ASSIGNMENT - 2
c. s1>s2
d. s1>=s2
e. s1.isdisjoint(s2)
f. s1.issubset(s2)
g. s1.issuperset(s2)
h. s2.issubset(s1)
i. s2.issuperset(s1)
j. s1!=s2
k. 4 not in s2?
l. 1 in s2?
PYTHON ASSIGNMENT - 2
b. s1<=s2
c. s1>s2
d. s1>=s2
e. s1.isdisjoint(s2)
f. s1.issubset(s2)
g. s1.issuperset(s2)
h. s2.issubset(s1)
i. s2.issuperset(s1)
j. s1!=s2
PYTHON ASSIGNMENT - 2
b. s1.issubset(s2)
c. s1.isspuerset(s2)
d. s2.issuperset(s1)
e. s2>s1
f. s1<s2
g. s1>=s2
h. s2<=s1
i. s2=s1
39. Create one empty dictionary and add any 5 key:value pairs?
40. Can we list and tuple as values in dictionary? If yes then create one dictionary with tuple and
list as values?
PYTHON ASSIGNMENT - 2