P2S2Internal - QuestionPaper - C15
P2S2Internal - QuestionPaper - C15
Input:
Enter a word = ‘20 extremely useful single-line Python codes Medium
Expected output
Count of vowel is :
Count of consonant is :
Uppercase :
Lowercase :
Digits :
4.A) Write a program that has dictionary of cool drink names and their mrp rates.
Find out the expensive cool drink?
Note: do not use max( ) function to find expensive. 5M
drinks={'Maaza':89,'7Up':45,'Pepsi':96,’Thumsup’:90}
Output:D1 = {'first_name' : 'Jim', 'age' : 35, 'height' : 6.0 , 'job' : 'senior data
analyst', 'company': 'XYZ'} 5M
SET-B
Each Question Carries 10 M
1. Write a Program to find the LCM of Two Numbers 5M+5M
3.Write a Python program to print triangle of alphabets in reverse pattern using for
loop?
G
FG
EFG
DEFG
CDEFG
BCDEFG
ABCDEFG
4. A).Write a program to swap two numbers without using a temporary variable.
4.B).Write a program to input n numbers from the user. Store these numbers in a
tuple. Print the maximum and minimum number from this tuple
SET-C
Each Question Carries 10 M
1. Write a python program to get output mentioned below alphabet pattern in
alpha.txt file ? 10 M
A
BC
DEF
GHIJ
KLMNO
PQRSTU
2. Write a python program to create a list of values prompt by the user and sort in
increasing order? Without using built-in functions?
4. Create a dictionary of phone dictionary, where the key is the name and the value
is phone number , prompt the key and value from the user? Perform the following
Operations on this dictionary:
(a) Display the keys
(b) Display the values
(c) Display the items
(d) Find the length of the dictionary
(e) Check if one of the name is present or not
(f) Retrieve the value corresponding to the any one name
(g) Delete the item from the dictionary corresponding to the
any one name