0% found this document useful (0 votes)
14 views3 pages

P2S2Internal - QuestionPaper - C15

The document outlines the internal lab exam for Python Programming Language at Rajiv Gandhi University of Knowledge Technologies for the academic year 2024-25. It includes various programming tasks and questions across three sets, focusing on concepts such as functions, data structures, and algorithms. Each question is assigned a specific mark value, emphasizing practical coding skills and problem-solving abilities.

Uploaded by

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

P2S2Internal - QuestionPaper - C15

The document outlines the internal lab exam for Python Programming Language at Rajiv Gandhi University of Knowledge Technologies for the academic year 2024-25. It includes various programming tasks and questions across three sets, focusing on concepts such as functions, data structures, and algorithms. Each question is assigned a specific mark value, emphasizing practical coding skills and problem-solving abilities.

Uploaded by

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

Rajiv Gandhi University of Knowledge Technologies

(Catering to the Educational Needs of Gifted Rural Youth of Andhra Pradesh)


RGUKT-Ongole Campus, RGUKT-A.P.
Academic Year 2024 – 25: Semester II 05-04-2025
(PUC) 23PIT2210- Python Programming Language Internal Lab
Year: PUC2 Class:C15
---------------------------------------------------------------------------------------------------
SET-A
Each Question Carries 10 M
1. Given 3 int values, a b c, return their sum. However, if one of the values is the
same as
another of the values, it does not count towards the sum.
(1, 2, 3)-->6
(3, 2, 3)-->2
(3, 3, 3)-→0

2.Get the below mentioned output in file.txt

Please Enter the total Number of Rows : 5


Please Enter the total Number of Columns :7
Print Number Pattern - 1 and 0 in alternative rows
1 1 1 1 1 1 1
0 0 0 0 0 0 0
1 1 1 1 1 1 1
0 0 0 0 0 0 0
1 1 1 1 1 1 1 10M

3. Define a function which counts Uppercase,Lowercase, vowels and consonant in


a word. 10M
Note: Use function name as Counts( ) , without using builtin functions.

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}

4.B) Replace Dictionary Values From Other Dictionary by using loop?

D1 = {'first_name' : 'Jim', 'age' : 23, 'height' : 6.0 , 'job' : 'developer', 'company':


'XYZ'}
D2 = {'age' : 35, 'job' : 'senior data analyst'}

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

Write a Program to find the GCD of Two Numbers

2. Write a program to print all Strong numbers between 1 to n?

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?

3. Write a program to reverse the integer value?


Note:Without using built-in functions?
Input:678
Output:876

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

You might also like