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

CSE3011_Python Programming_List of Experiments

The document lists various Python programming tasks categorized by topics such as Numeric Data Types, Strings, Operators, Conditional and Looping, Lists & Tuples, Dictionary, Functions, Regular Expressions, Class & Object, Exception Handling, File Handling, and MySQL. Each category contains specific programming exercises, including writing functions, manipulating data structures, and handling exceptions. The tasks range from basic operations like printing prime numbers to more complex operations involving databases and file handling.

Uploaded by

K L Nayak
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

CSE3011_Python Programming_List of Experiments

The document lists various Python programming tasks categorized by topics such as Numeric Data Types, Strings, Operators, Conditional and Looping, Lists & Tuples, Dictionary, Functions, Regular Expressions, Class & Object, Exception Handling, File Handling, and MySQL. Each category contains specific programming exercises, including writing functions, manipulating data structures, and handling exceptions. The tasks range from basic operations like printing prime numbers to more complex operations involving databases and file handling.

Uploaded by

K L Nayak
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Topics S. No.

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))

Use 'print_details' method to print the details of employee. Consider the


sample data:
"Adams " "E7876" 50000 "Accounting"
"Jones" "E7499" 45000 "Research"
"Martin" "E7900" 50000 "Sales"
"Smith" "E7698" 55000 "Operations"
9.4 Write a python program to demonstrate access specifiers.
9.5 Write a python program to apply polymorphism.
9.6 Write a python program to demonstrate inheritance.
9.7 Write a python program for method overriding.
9.8 Write a python program to define abstraction.
9.9 Write a python program to demonstrate Interface.
Demonstrate a python code to print try, except and finally block
10.1
statements
10. 10.2 Demonstrate a python code to implement abnormal termination
Exception Write a Python program that prompts the user to input an integer and
10.3
Handling raises a ValueErrorException if the input is not a valid integer.
Write a Python program that executes division and handles an
10.4
ArithmeticError exception if there is an arithmetic error.
Write a python code to perform following operations with a text file:
11.1
i) create ii) open iii) read iv) write v) append vi) close vii) delete
Write python program to find the most frequent words in a text read
11.2
from a file.
11. File
11.3 Write a python program to read first n lines of a file.
Handling
11.4 Write a python program to count the number of lines in a text file.
11.5 Write a python program to count the frequency of words in a file.
11.6 Write a python program to copy the contents of a file to another file.
11.7 Write a python program to search for a string in text file
Write a python code to read a csv file using pandas’ module and print
12. 12.1
the first and last five lines of a file.
Handling
Write a python program to create, write and read CSV files Into a
csv files 12.2
Dictionary.
13.1 Write a python program to program to connect with MySQL database.
13. MySQL Write a python program to perform following database operations:
13.2
i) create ii) alter iii) insert iv) update v) drop vi) delete

You might also like