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

PythonPracticalQuestions 1

The document contains instructions for writing Python programs and functions to perform various tasks: 1. Calculate the number of vowels in a string 2. Calculate discount on purchases over 1000 rupees 3. Calculate net bonus amount based on salary and years of service 4. Create a lambda function to multiply values and use it to print a number table 5. Square and cube numbers in a list using lambda 6. Check if a rectangle defined by length and breadth is a square 7. Check if a triangle defined by 3 sides is equilateral 8. Define classes to calculate mathematical operations on numbers 9. Print even and odd numbers from 1 to 100 with classes 10. Print a number table with a

Uploaded by

Anirudh Khattri
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

PythonPracticalQuestions 1

The document contains instructions for writing Python programs and functions to perform various tasks: 1. Calculate the number of vowels in a string 2. Calculate discount on purchases over 1000 rupees 3. Calculate net bonus amount based on salary and years of service 4. Create a lambda function to multiply values and use it to print a number table 5. Square and cube numbers in a list using lambda 6. Check if a rectangle defined by length and breadth is a square 7. Check if a triangle defined by 3 sides is equilateral 8. Define classes to calculate mathematical operations on numbers 9. Print even and odd numbers from 1 to 100 with classes 10. Print a number table with a

Uploaded by

Anirudh Khattri
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1.

Write a python program having a user defined function which will calculate the total number of
vowels used in string entered by a user.
2. A shop will give discount of 10% if the cost of purchased quantity is more than 1000 rupees.
Now write a python program having a user defined function which will first calculate whether a
user purchased quantities more than 1000 rupees or not and then accordingly it will print the total
cost for user.
3. Suppose a company decided to give bonus of 5% to their employee if his/her year of service in
the company is more than 5 years. Now write a python program having a user defined function
which will print the net bonus amount. Ask user to input the salary and the year of service.
4. Write a lambda function in python which will multiplies two values (i.e. x*y). Now using this
function write a python program to print the table of a number (from 1 to 10) entered by a user.
5. Write a Python program to square and cube every number in a given list of integers using
Lambda.
6. Write a python class which can take values of length and breadth of a rectangle from user and
check if it is square or not. Take inputs of length and breadth from user.
7. Write a python program which can take the 3 sides of a triangle – x, y and z from a user. Now
create a class which can determine whether the triangle is equilateral or not.
8. Write 4 python class to which can calculate addition, multiplication, subtraction and division of
two numbers. Take inputs from user.
9. Create a python class which have a function which will print all even numbers from 1 to 100 and
another function which will print all odd numbers from 1 to 100.
10. Write a python program that have a class having function that will print table of any number.
11. Make a function which will reverse a string and integer. Now ask user to enter any value (either
string or non-decimal number) and check whether it is a palindrome value or not.
12. Write a python program to make a list of 5 subject marks obtained by two student. Make a
function to find which list of marks have highest sum of values.
13. Write a python program to create a list of 5 subject marks obtained by a student. Now make a
function which will calculate percentage of the marks present in the list.
14. Make a function to add values in a dictionary having student record – name, roll number, and last
3 semester’s percentage. Also make a function to calculate the average percentage secured by a
student till current semester. Now print the calculated average percentage of the student.
15. Make a function which will return minimum and maximum value among 10 integer values. Write
a python program to ask user to enter any 10 integer values, store them in the form of a set and
print the minimum and maximum value present in it.
16. Write a python program to create a list with some values (integer, float, and string). Now make a
function which will remove all string values, and another function to find the sum of remaining
numerical values.
17. Make a python function to count the total occurrence of each character in a string in the form of a
dictionary. Now ask user to enter any string and print the occurrence in the following manner.
Input String: good morning
Output: {'g': 2, 'o': 3, 'd': 1, ' ': 1, 'm': 1, 'r': 1, 'n': 2, 'i': 1}

You might also like