Python Revision tour - 2 || Type A || Sumita Arora || Class 12 || Computer science || Information practices || Solution ||
Q 1 = What is the internal structure of Python strings ?
Q 3 = Discuss the utility and significance of Lists, briefly.
Q 4 = What do you understand by mutability ? What does "in place" task mean ?
Q 5 = Start with the list [3, 9, 10]. Do the following :
(a) Set the second entry (index 1) to 17
(b) Add 4, 5 and 6 to the end of the list
(c) Remove the first entry from the list
Q 6 = What's a [1: 1] if a is a string of at least two characters ? And what if string is shorter ?
Q 8 = What are the two ways to remove something from a list? How are they different ?
Q 10 = In the Python shell, do the following :
(i) Define a variable named states that is an empty list.
(ii) Now add 'Punjab' to the end of the list.
(iv) Define a variable states2 that is initialized with 'Rajasthan', 'Gujrať, and 'Kerala'.
(v) Add 'Odisha' to the beginning of the list.
(viii) Remove the 5th state from the list and print that state's name.
Q 11 = Discuss the utility and significance of Tuples, briefly.
(a) what is the difference (if any) between a * 3 and (a, a, a)?
(b) is a * 3 equivalent to a + a + a ?
(c) what is the meaning of a[1:1] ?
(d) what's the difference between a[1:2] and a[1:1] ?
Q 13 = What is the difference between (30) and (30,) ?
Q 14 = Why is a dictionary termed as an unordered collection of objects ?
Q 15 = What type of objects can be used as keys in dictionaries ?
Q 18 = How is del D and del DI<key>] different from one another if D is a dictionary ?
Q 20 = What is sorting ? Name some popular sorting techniques.
THANK U....
ReplyDeleteWelcome :)
Delete2nd answer is wrong
ReplyDeleteit would be
a = input("Enter a string = ")
for i in range (2 , len(a)+2 , 2 ) :
print( a [ i - 2 : i])
or
a = input("Enter a string = ")
for i in range (0 , len(a), 2 ) :
print( a [ i : i+2])
Our program is right. Please run that answer in IDLE Python.
DeleteQuestion 5(b), it should be l.extend([4,5,6])
ReplyDeleteOk, I will correct it.
DeleteThabk you and may the force be with you
ReplyDeletethank*****
DeleteWelcome 😊😊
Deleteupdate the question
ReplyDeleteTell me questions.
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )