0% found this document useful (0 votes)
11 views

Third Assignment

The document outlines ten programming tasks in Python, including user input for days of the week, unit conversions, vowel checks, letter case counting, even or odd evaluations, dictionary creation and merging, value existence checks, and generating dictionaries based on input numbers. Each task specifies the expected input and output format. The tasks cover fundamental programming concepts such as conditionals, loops, and data structures.

Uploaded by

v.manohar792
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Third Assignment

The document outlines ten programming tasks in Python, including user input for days of the week, unit conversions, vowel checks, letter case counting, even or odd evaluations, dictionary creation and merging, value existence checks, and generating dictionaries based on input numbers. Each task specifies the expected input and output format. The tasks cover fundamental programming concepts such as conditionals, loops, and data structures.

Uploaded by

v.manohar792
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1) Write a program that prompts the user to enter a number between 1-7 and then displays the

corresponding day of the week.

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?

6) Create a Dictionary from the below list


a = ['Codegnan','Manohar','Python'] and the dictionary should be as d = {'Codegnan': 'Hyd',
'Manohar': 'Hyd','Python': 'Hyd'}

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']}

Output should be as:


{'sno': [1, 2, 3, 4], 'names': ['Codegnan', 'Manohar', 'Python'], 'Gender': {'Female', 'Male'}, '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.

Suppose the following input is supplied to the program:


iris,air,manohar,bat,cat,mat

Output should be as:


air,bat,cat,iris,mat,manohar

You might also like