1.
Write a Python function topper() that accepts a dictionary resultsheet that contains
student details { rollno: [ name,mark]}. The function should return the name and rollno
of the student who scored highest mark. Display as “Topper is xyz with rollno abc”.
2. Write a function CREATE_DIC(n), where n is a number taken as argument to the
function, and create a dictionary - Cube ,where the keys are the numbers from 1 till the
number n and the values are the cube of it. Example if the given number is 5 , the output
expected is Cube={1:1,2:8,3:27,4:64,5:125}
3. Write a Python function add_emplyoee() that accepts a dictionary company_emplyoee,
an employee number, a name and department. The function should add the employee
number as key and name, department as value to the dictionary. If the employee
number already exists, print "Employee already exists" instead of updating it.
4. Write a function CountVowel(STRING), that accepts one argument STRING ,find the
occurrence each vowel in it, store each vowel & its count as key-value pair in a
dictionary and return the dictionary.[Hint: While counting consider both upper and lower
case vowels]
For example,
if STRING = "A girl sings beautifully." the function should return the dictionary
{'a': 2, 'i': 3, 'e': 1, 'u': 2}
5. Write a Python function update_score() that accepts a dictionary named scores, a
player name and a new score. If the player name already present in dictionary, update
the score, otherwise, display the message "Player not found".
6. Write a function countNow(PLACES) in Python, that takes the dictionary, PLACES as an
argument and displays the names (in uppercase)of the places whose names are longer
than 5 characters.
7. Write a user defined function in Python named showGrades(S) which takes the
dictionary S as an argument. The dictionary, S contains Name:[Eng,Math,Science] as
key:value pairs. The function displays the corresponding grade obtained by the
students according to the following grading rules :
For example : Consider the following dictionary: S={"NIDHI":[92,86,64],"PRINCE":
[65,42,43],"PRACHI":[92,90,88]}
The output should be : NIDHI – B
PRINCE – C PRACHI – A
8. Write a Python function higest_scorer() that accepts a dictionary D1 containing Name
and scores. The function should find the name of the highest scorer of the
student and print it.
9. Write a Python function add_teacher() that accepts a dictionary , a teacher name, and
a phone number. If teacher name does not exist, add it. If the name already exists, print
"Contact already exists".
10. Write a Python function delete_contact(phone_book, name) that accepts a dictionary
phone_book and a name. The function should remove a contact with the parameter
‘name’ from the dictionary. If the contact doesn’t exist, print "Contact not found".
Note: Dictionary has name as key and phone number as value.