CSE3011_Python Programming_List of Experiments
CSE3011_Python Programming_List of Experiments
List of Programs
1.1 Write a python program to print first n prime numbers.
1. Numeric 1.2 Write a python program to multiply matrices.
Data Types Write a python program which accepts the radius of a circle from user
1.3
and computes the area (use math module)
Write python program to let user enter some data in string and then
2.1
verify data and print welcome to user
Write a Python program that checks whether a passed string is a
2.2
palindrome or not.
Write a Python program to count the occurrences of each word for given
2.3
2. Strings string.
Write a Python function to reverse a string. Sample String: "1234abcd"
2.4
Expected Output: "dcba4321"
Write a Python program to remove the characters which have odd index
2.5
values of a given string.
2.6 Write python program to take command line arguments (word count).
Write the output of the following Python program:
a = 10
b=4
print (a & b)
3.1 print (a | b)
print (~a)
3. Operators
print (a ^ b)
print (a >> 2)
print (a << 2)
Write a program to create a menu with the following options and
3.2 accepts users input and perform the operation accordingly:
i) Addition ii) Subtraction iii) Multiplication iv) Division
4.1 Write a python program to print a number is even/odd using if-else.
4.2 Write a python program to find largest number among three numbers
Write a python Program to read a number and display corresponding
4.3
day using if_elif_else?
4.4 Write a Python program to get the Fibonacci series between 0 to 50.
4.5 Write python program to print list of numbers using range and for loop.
Write a Python program to construct the following pattern, using a
4. nested for loop.
Conditional *
and Looping **
***
4.6 ****
*****
****
***
**
*
Create a list and perform the following methods 1) insert() 2) remove()
5.1
3) append() 4) len() 5) pop() 6)clear()
Create a tuple and perform the following methods 1) Add items 2) len()
5.2
5. Lists & 3) check for item in tuple4)Access items
Tuples 5.3 Write a Python program to sum all the items in a list.
Write a Python function that takes two lists and returns true if they are
5.4
equal otherwise false.
5.5 Write python program to store strings in list and then print them
Create a dictionary and apply the following methods 1) Print the
6.1
dictionary items 2) access items 3) useget() 4)change values 5) use len()
6. Write a Python script to check if a given key already exists in a
6.2
Dictionary dictionary.
Write a Python script to sort (ascending and descending) a dictionary by
6.3
value.
Write python program in which a function is defined and calling that
7.1
function prints ‘Hello World’.
Write python program in which a function (with single string parameter)
7.2 is defined and calling that function prints the string parameters given to
7. Functions function.
Write a python program to find factorial of a given number using
7.3
functions
Write a Python function to calculate the factorial of a number (a non-
7.4
negative integer). The function accepts the number as an argument.
Write a Python program to check the validity of passwords input by
users using regular expression. Validations are:
̶ At least 1 letter between [a-z] and 1 letter between [A-Z]
8. Regular
8.1 ̶ At least 1 number between [0-9]
Expression
̶ At least 1 character from [$#@]
̶ Minimum length 6 characters
̶ Maximum length 16 characters
Write python program in which a class is defined, then create object of
9.1
that class and call simple ‘print function’ defined in class.
Write a python Program to call data member and function using classes
9.2
and objects
Write a Python class Employee with attributes like emp_name, emp_id,
emp_salary, emp_department and methods like calculate_salary, and
print_details. Use 'calculate_salary' method takes two arguments: salary
9. Class & and hours_worked. If the number of hours worked is more than 50, the
Object method computes overtime and adds it to the salary. Overtime is
calculated as following formula:
9.3
overtime = hours_worked – 50
overtime amount = (overtime * (salary / 50))