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

Python Programming Front

The document outlines a series of programming tasks and exercises primarily focused on Python. These tasks include calculating interest on loans, determining character types, calculating gross salaries, and performing various string and list manipulations. Additionally, it covers file operations, exception handling, and the use of libraries like NumPy, Pandas, and Matplotlib for data analysis and visualization.

Uploaded by

mohdaamir0360
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)
6 views3 pages

Python Programming Front

The document outlines a series of programming tasks and exercises primarily focused on Python. These tasks include calculating interest on loans, determining character types, calculating gross salaries, and performing various string and list manipulations. Additionally, it covers file operations, exception handling, and the use of libraries like NumPy, Pandas, and Matplotlib for data analysis and visualization.

Uploaded by

mohdaamir0360
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

INDEX

S. Page Remark/
Objective Date
No. No. Sign
WAP to calculate and display interest on a loan
amount. You would need three variables to hold
1. ‘principal’, ‘Rate_of_interest’(%) and ‘time’ in years
and can use the formula
Interest = (principal * rate_of_interest * time) / 100
Write a Python program to input any character and
2. check whether it is alphabet, digit or special character.
Write a Python program to input basic salary of an
employee and calculate its Gross salary according to
following:
3.
Basic Salary <= 10000 : HRA = 20%, DA = 80%
Basic Salary <= 20000 : HRA = 25%, DA = 90%
Basic Salary > 20000 : HRA = 30%, DA = 95%
Write a Python program to calculate factorial of a
4.
number.

Write a Python program to find sum of all odd


5. numbers between 1 to n.

Write a program to check whether a given string is


6. palindrome or not.
Write a Python program to find the first appearance of
the substring 'not' and 'poor' from a given string,
7. replace the whole 'not'...'poor' substring with 'good'.
Return the resulting string.
Given a string containing uppercase characters (A-Z),
compress the string using Run Length encoding.
Repetition of character has to be replaced by storing
the length of that run.
8. Write a python function which performs the run length
encoding for a given String and returns the run length
encoded String. Provide different String values and
test your Program.
Write a Python function that takes a list and returns a
9. new list with unique elements of the first List.
Write a program which takes 2 numbers as input and
prints a list of all the prime numbers between the two
10.
given numbers.
Write a python program to remove a tuple of given
length.
Input: t1 = [(4, 5), (4,), (8, 6, 7), (1,), (3, 4, 6, 7)]
11. K=1, where is k is the length of element that need to be
deleted.
Output: [(4, 5), (8, 6, 7), (3, 4, 6, 7)]
Cate Hospital wants to know the medical specialty
visited by the maximum number of patients. Assume
that the Patient id of the patient along with the medical
specialty visited by the patient is stored in a list. The
details of the medical specialties are stored in a
12. dictionary as follows:
{ “P”:”Pediatrics”, “O”:”Orthopedics”, “E”:”ENT” }
Write a function to find the medical specialty visited
by the maximum number of patients and return the
name of the specialty.
a) Write a program which takes a dictionary as input
and perform add, update, delete operations on that
13. dictionary.
b) Write a program to sort a dictionary by its values.
Write a Python function to check whether a number is
perfect or not. a perfect number is a positive integer
that is equal to the sum of its proper positive divisors,
that is, the sum of its positive divisors excluding the
14.
number itself (also known as its aliquot sum).
Equivalently, a perfect number is a number that is half
the sum of all its positive divisors.
Write a program that reads the content of a file and
15. writes it to another file. Also add the functionality to
place the file pointer in the file.
Write a Python program that takes a text file as input
16. and returns the number of words of a given text file.
Write a python program to implement following
methods of random module.
a. Choice (),
17.
b. Shuffle (),
c. Random ()
Write a Python program that executes an operation on
a list and handles an IndexError exception if the index
18.
is out of range.
Create a custom exception SalaryNotInRangeError.
19. Input employee salary and name raise custom Error
SalaryNotInRangeError if empsalary50000 print name
of employee and message if salary is not in range else
print salary is in range.
a) Use NumPy to perform array operations.
b) Use Pandas to read .csv files and perform basic data
20. analysis (mean, max, min).
c) Use Matplotlib to plot simple graphs.

You might also like