You are on page 1of 2

1.

Count the number of ovels, consonants, numbers, uppercase letters,


lowercase letters, numeric characters, white space characters.
4. Matrix multiplication using list comprehension
5. Simulate kannada to English dictionary
6. Consider the list sub1={ML,Py,DS,AI,Java,C++ }
sub2={ADBMS,STP} perform the following operations
i) Insert the Sub AWP at the position 5 and IDE at the position 2 from the last
ii) Return the first 4 elements from the list and change the value of the item in the
index 6 to Android
iii) Join 2 list sub1 and sub2 and Return the total elements in the list
iv) Print the list in the ascending order and descending order
v) Create a nested list of subjects RM and J2EE and insert the subject ADA
into the nested list after J2EE
vi) Delete the element at the index position 6 and return the index of a particular subject
vii) Print a list after removing the 0th, 4th and 5th elements.

viii) reverse a list of lists

9. Write a python program to implement set operations

10. Show the output of the following

Suppose s1,s2,s3 and s4 are four strings assigned as shown below.

S1=” Welcome to Python class “

S2=s1

S3=”Welcome to Python Class”

S4=”to”

i) s1==s2 ii) s2.count(‘O’) iii)s1>s4

iv) max(s2) v) s3.find(s4) vi) s1.startswith(“Wel”)

vii) s4.isalpha() viii) s2+s3 ix)s1.lstrip() x) s3.isspace()

11) Show the output of the following code


b) Show the output of the following
S1=” Python is a good programming language “
i)s1.isspace() ii)s1.find(“language”) iii) txt1=”{0} {1} dynamically programmed{5}.format()
iv)s1.istitle() v)s1.swapcase()
Mydic={“apple”:10,”banana”:5,”orange”:10,”chiku”:20}

i) Print(mydic[“chiku”])

ii) Print(list(mydic.keys())

iii) Print(“banana” in mydic)

iv) Print(“papaya in mydic)

v) Print[“orange”]+=50)

12) Justify strings and tuples are immutable with suitable examples

13) a) st="Python is a very flexible language . Python is a portable language, Python is in


more demand now". Perform the following string operations.
i) Returns the number of occurrences of the particular substring.
ii) split the given string
iii) join the string using and .
iv)replace python with reactjs.
v)translate all aeiou to 12345 in the string
vi) convert the given string into tuples after split.

b) Show the output of the following

S1=” Python is a good programming language “

i)s1.isspace() ii)s1.find(“language”) iii) txt1=”{0} {1} dynamically programmed{5}.format()


iv)s1.istitle() v)s1.swapcase() vi)s1.split()

You might also like