Computer Science Worksheet
Computer Science Worksheet
2. Write the Python statement for each of the following tasks using BUILT-IN
functions/ methods only:
(i) To insert an element 200 at the third position, in the list L1.
(ii) To check whether a string named, message ends with a full stop /
period or not.
(iii) To delete an element Mumbai : 50 from Dictionary D.
(iv) To display words in a string S in the form of a list
iii) S=”MARSHMELLOW”.partition(‘H’)
print(S[::2])
10. Write a Python program to accept a list and remove duplicates if any from the
list.
For example if the list entered is [10, 20, 30, 20, 10, 50, 60, 40, 80, 50, 40]
Then the output should be [10,20,30,50,60,40,80]
WORKSHEET – WORKING WITH FUNCTIONS
Change(L)
for i in L:
print(i,end='$')