0% found this document useful (0 votes)
3 views1 page

Programs For Python Programming Lab Test-2

The document outlines a Python Programming Lab Test scheduled for June 1, 2024, from 11 am to 12:50 pm. It includes a series of programming tasks such as performing arithmetic operations, calculating factorials, implementing search functions, and using classes and inheritance. Additionally, it requires creating user-defined modules and handling file input/output operations.

Uploaded by

ay97yticm
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)
3 views1 page

Programs For Python Programming Lab Test-2

The document outlines a Python Programming Lab Test scheduled for June 1, 2024, from 11 am to 12:50 pm. It includes a series of programming tasks such as performing arithmetic operations, calculating factorials, implementing search functions, and using classes and inheritance. Additionally, it requires creating user-defined modules and handling file input/output operations.

Uploaded by

ay97yticm
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

Python Programming Lab Test

Date : 1st June 2024 , 11am - 12.50pm

SL.
No.
QUESTIONS
Write a python program to read 2 numbers from the keyboard and perform the basic arithmetic
1
operations based on the choice. (1-Add, 2-Subtract, 3-Multiply, 4-Divide)
2 Write a python program to find the factorial of a number using a while loop.
3 Write a python program to add 10 numbers by inputting each from the keyboard using a for loop.
Write a python function linearSearch() to read an array and search for the key element. Display the
4
appropriate messages. Use the recursive function.
Write a python program to define a function max_of_three() that takes three numbers as arguments
5
and returns the largest of them using default arguments.
Write a python program to define a function generate_n_chars() that takes an integer n and a
6 character c and returns a string, n characters long. For example, generate_n_chars(5,"x") should return
the string "xxxxx“ using keyword only parameters.
Write a python program to implement a stack and queue using lists
7
Write a Python program to store PROFILE_DATA(user_id, name, DOB, qualification, work
8
experience) in a dictionary and print the dictionary contents. (import pprint)
Create a user defined module using python to execute the following
9
a) area of circle b) area of triangle c) area of rectangle.
Write a python program to create a text file and ask the user to enter 5-6 lines of text. Display the
10
longest and the shortest word from the file. Display the length of these words.
Develop a python program that uses class Student which prompts the user to enter marks in three
subjects and calculates total marks, percentage and displays the score card details. [Hint: Use list to
11 store the marks in three subjects and total marks. Use __init__() method to initialize name, USN and
the lists to store marks and total, Use getMarks() method to read marks into the list, and display()
method to display the score card details.
Write a python program to implement the following using Inheritance
Employee
______________|______________
12 | |
Clerk Software Engineer
|
Team Leader

You might also like