PROGRAMS USING FUNCTION
1. Write a function lst_sort(Arr,n) in Python, that accepts a list Arr of
string elements and the number of strings n as its arguments and
sort the strings in descending order using bubble sort
technique.
2. Write a function fn(A,n) in Python, that accepts a tuple A of integer
elements and the number of elements n as its arguments and
print the prime palindrome numbers.
3. Write a user defined function words(S) in Python, that accepts a
string S as arguments and that separately counts and displays the
number of vowels , consonants, digits and special characters in a
string.
4. Write a function Upper_case(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.
For example, Consider the following dictionary
PLACES={1:"Delhi",2:"London",3:"Paris",4:"New York",5:"Doha"}
The output should be: LONDON NEW YORK
5. Write a function, lenWords(STRING), that takes a string as an
argument and returns a tuple containing length of each word of a
string.
For example, if the string is "Come let us have some fun",
the tuple will have (4,3, 2, 4, 4, 3)
6. Write a function Fibo_Series(n), where n is the number of
Fibonacci terms to be generated is passed as an argument to the
function. Store the term number and actual term of the series as
key:value pair in the dictionary. Display the dictionary
in the function.
Eg: if n is 5, then the dictionary will be:
{1:0,2:1,3:1,4:2,5:3}