Third Assignment
Third Assignment
2) Write a Python program to convert Imperial Units of Inches with the Metric Units of Centimetres
by if-elif-else by accepting float value of units and ask whether inches or cms from the user and
then convert that means two inputs from the user?
3) write a program to determine whether the character entered is a vowel or not by using logical
operator?
4) Write a program that accepts a sentence and calculate the number of upper case letters and
lower case letters.
Suppose the following input is supplied to the program:
Hello Codegnan!
Then, the output should be:
UPPER CASE 2
LOWER CASE 11
5) Write a program to evaluate whether the given number is even or odd by accepting input from
the user?
7) Write a Python program to check if the given value exists in dictionary or not using if-else by
accepting value as string from the user?
Your input is
a ={'sno':1,'name':'Codegnan','place': 'Hyderabad'}
8) Merge two Python dictionaries into one new dictionary?
your inputs are as follows:
a = {'sno':[1,2,3,4],'names':['Codegnan', 'Manohar','Python']}
b={'Gender':{'Male','Female'},'place':[ 'Hyderabad', 'JNTU']}
9) With a given number n, write a program to generate a dictionary that contains (i, i*i) such that is
an integral number between 1 and n (both included) and then the program should print the
dictionary.
Suppose the following input is supplied to the program:
8
Then, the output should be:
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64}
10) Write a program that accepts a comma separated sequence of words as input and prints the
words in a comma-separated
sequence after sorting them alphabetically.