Practicalfile XI 24
Practicalfile XI 24
Write a function that takes a list of numbers as an argument and return the sum of
all numbers which are divisible by 5. Also write a complete Python program to call
this function.
Write a function that takes a string as an argument and return Palindrome if the
string is a palindrome otherwise return Not A Palindrome. Also write a complete
Python program to call this function.
Write a Python function that takes a list of strings as an argument and displays the
strings which starts with “S” or “s”. Also write a program to invoke this function.
Write Python script to create a dictionary with players name and their score. Write a
function that accepts this dictionary as an argument and displays the name of the
player with the highest score.
Write a Python program to remove the nth index character from a nonempty string.
If input string is “python” and index is 3, Expected output :”pyton”
Write a menu driven program to accept a string and do the following operation as
per
the choice of the user
a. Display length of string
b. Display no. of words
c. Display no. of vowels
d. Reverse string
Write a program to enter a list and then push all the zeros in the list to the end of the
list.
For example: If the list contains [0, 2, 3, 4, 6, 7, 0, 1], then the program should
re-arrange the
elements as [2, 3, 4, 6, 7,1, 0, 0]
Write a program to input a list containing names of cities and then display the
names of all those
cities that start with the alphabet ‘A’.
For example if the list contains [“AHMEDABAD”, CHENNAI”, “NEW DELHI”,
“AMRITSAR”,“ AGRA”],
then the program should print AHMEDABAD, AMRITSAR and AGRA.
You're creating a simple grading system for students. You need a function assign_grade()
that takes the score of a student (between 0 and 100) and assigns a grade based on the
following conditions:
● 90 or above: "A"
● 80 to 89: "B"
● 70 to 79: "C"
● 60 to 69: "D"
● Below 60: "F"