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

Python Programming Lab Question Bank

The document is a question bank for a Python programming lab mid-exam, containing 19 programming tasks. These tasks cover various topics such as calculating compound interest, checking voter eligibility, string manipulation, and file handling. Each question requires the student to write a specific Python program or function to demonstrate their coding skills.

Uploaded by

avutu_kunduru
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)
2 views1 page

Python Programming Lab Question Bank

The document is a question bank for a Python programming lab mid-exam, containing 19 programming tasks. These tasks cover various topics such as calculating compound interest, checking voter eligibility, string manipulation, and file handling. Each question requires the student to write a specific Python program or function to demonstrate their coding skills.

Uploaded by

avutu_kunduru
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 – Question Bank for Mid Exam

1. Write a program to calculate compound interest when principal, rate and number of periods
are given.
2. Read the name, address, email and phone number of a person through the keyboard and
print the details.
3. Write a python program weather he/she is eligible to cast a vote based on the age?
4. Print if a number (int) is odd or even
5. Write a program that accepts a string from user and redisplays the same string after
removing vowels from it?
6. Python program to print all prime numbers in a given interval (use break)
7. Print the below triangle using for loop.
5
44
333
2222
11111
8. Write a program to change a given string to a new string where the first and last characters
have been exchanged.
9. Write a program to check whether the entered string is palindrome or not?
10. Write a function called remove duplicates that takes a list and returns a new list with only
the unique elements from the original. Hint: they don’t have to be in the same order.
11. Write a python Program to add a comma between the characters. If the given word is
'Apple', it should become 'A,p,p,l,e'
12. Write a python code to read dictionary values from the user. Construct a function to invert
its content. i.e., keys should be values and values should be keys.
13. Python Program to Print the Fibonacci sequence using recursive function
14. Write Python Program by using a lambda function to add and subtract two variables
15. Write a Python program to Define a function ‘get_BiggerNumber (x,y)’ to take in two
numbers and just ‘print’ the bigger of them. Take the arguments as (100,200)
16. Write a script that asks users for the temperature in F and prints the temperature in C.
(Conversion: Celsius = (F - 32) * 5/9).
17. Write a Python code to merge two given file contents into a third file.
18. Write a Python code to open a given file and construct a function to check for given words
present in it and display on found.
19. Write a python program to read and write the details of 3 students in a file ‘[Link]’.
Place details of Name, Gender, Age, Place in the file. Append the following details to the
‘[Link]’ file: Amar, Male,19, Hyderabad. Print the details after appending

You might also like