Lab Assignment
Lab Assignment
String Manipulation
6. Write a program to create a new string with all the consonants deleted from the string
"Hello, have a good day".
7. Write a program that takes your full name as input and displays the abbreviations of the
first and middle names except the last name which is displayed as it is. For example, if
your name is Robert Brett Roser, then the output should be R.B.Roser.
8. Write the string after the first occurrence of ',' and the string after the last occurrence of
',' in the string "Hello, Good, Morning, World".
9. Write a program to find the length of the string "refrigerator" without
using len function.
List
10. Take 10 integer inputs from user and store them in a list. Again ask user to give a
number. Now, tell user whether that number is present in list or not.
11. Make a list by taking 10 input from user. Now delete all repeated elements of the list.
E.g.-INPUT : [1,2,3,2,1,3,12,12,32]
OUTPUT : [1,2,3,12,32]
Tuple
12. A gymnast can earn a score between 1 and 10 from each judge; nothing lower,
nothing higher. There are a total of 5 judges. All scores are integer values; there
are no decimal scores from a single judge. Store the scores for one gymnast in a
tuple for 5 gymnasts. Print out the sentence, "The lowest possible score is ___, and
the highest possible score is ___." Use the values from your tuple. Also print the
list of scores as, "Gymnast x scored y scores", where x is the number of the
gymnast and y is the average score obtained.
Dictionary
13. Ask user to give name and marks of 10 different students. Store them in dictionary.
Sort the dictionary according to marks.