Python Programming Lab Index
Python Programming Lab Index
AUTONOMOUS
Vishnupur, BHIMAVARAM – 534202
INDEX
Prog. Page
Date Name of the Program Marks
No. No.
Amount in wallet
3 Find the total amount of money in the wallet, given the number of
currency notes of denomination Rs 500, Rs 200, R 100, Rs 50, Rs20
Bill value
Calculate the bill value based on the number of units of an item sold,
the cost of each item, discount percentage applicable and tax
4 percentage. Number of units, cost of each unit and tax percentage
should be given as input. Discount percentage applicable is
calculated using the following criteria - if the number of units is
greater than 10 discount is 15% else discount is 10%
Grade in subject
Calculate the grade awarded to a student in a subject based on the
marks scored. The grade is awarded based on the following criteria.
5
Marks:>=90 - Grade:A+, Marks:>=80 - Grade:A, Marks:>=70 -
Grade:B, Marks:>=60 - Grade:C, Marks:>=50 - Grade:D, Marks:>=40 -
Grade:E, Marks:<40 - Grade:F
Integer to Binary
8
Convert an integer number to its binary equivalent
Prog. Page
Date Name of the Program Marks
No. No.
Sum of multiples
15
Print the sum of the first 10 multiples of a given number
String operations
Perform the following string operations: first letter as the capital
18 letter, all the letters in upper case, all the letters in lower case, first
letter in each word capitalized, change the case of each letter, length
of the string, list of words
List Operations
Print all the elements, Replace the 6th element in the list with the
element 'New'. Add an element 200 at the end of the list, Remove
19 the element at index 5, Delete the elements from index 3 to index 7,
number of elements remaining, Check if the element 10 is present in
the list, maximum element and minimum element in the list, sum of
all the elements in the list, Convert the list to a tuple
Prog. Page
Date Name of the Program Marks
No. No.
Set Operations
Create a set, Print the elements, Add an element 2 using the add()
20 method, Add the elements 2,3,4 using the update() method, Add the
list [4,5] and the set {1,6,8}, Delete the element 4 using the discard
method, Delete the element 6 using the remove method
Dictionary operations
Create a dictionary and print all the elements, Print the number of
22
key, value pairs, Print all the keys, Print all the values, Print the keys
in a sorted order, Delete the element with key 3
Prog. Page
Date Name of the Program Marks
No. No.
Flatten List
Write a function called flatten_list that takes as input a list which
29
may be nested, and returns a non-nested list with all the elements of
the input list