Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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.
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.