Computer Programming
PRACTICAL FILE
By:-Kushagra Mathur | From EVDT | 2024-25
INDEX
Lab Class Name of the Experiment Page
No. No.
1. Install Python and set up the development 1.
environment.; Write a Python program to print
"Hello,
World!”; Write a Python program to calculate the
area of a circle given the radius.;
2. Write a Python program to check if a number is
even or odd.; Implement a simple calculator using
conditional statements; Write a Python program to
print the Fibonacci series using a for loop.
3. Implement a function to check if a given string is a
palindrome.; Perform various operations on lists
(e.g., sorting, slicing).; Use dictionaries to store
and retrieve student grades.
4. Create a class to represent a book with attributes
and methods.; Implement inheritance by creating
subclasses for different types of books.; Write a
generator function to generate the Fibonacci
series.
PAGE 1
Experiment – 1
Aim: Install Python and set up the development environment.; Write a
Python program to print "Hello World!”; Write a Python program to
calculate the area of a circle given the radius.;
Code:-
Output:-
PAGE 2
Experiment – 2
Aim: Write a Python program to check if a number is even or odd.;
Implement a simple calculator using conditional statements; Write a Python
program to print the Fibonacci series using a for loop.
Code 1:-
PAGE 3
Output 1:-
PAGE 4
Code 2:-
PAGE 5
Output 2:-
PAGE 6
PAGE 7
Code 3:-
Output 3:-
PAGE 8
Experiment – 3
Aim: Implement a function to check if a given string is a palindrome.;
Perform various operations on lists (e.g., sorting, slicing).; Use dictionaries
to store and retrieve student grades.
Code 1:-
Output 1:-
PAGE 9
Code 2:-
Output 2:-
PAGE 10
Code 3:-
Output 3:-
PAGE 11
Experiment – 4
Aim: Create a class to represent a book with attributes and methods.;
Implement inheritance by creating subclasses for different types of books.;
Write a generator function to generate the Fibonacci series.
Code 1:-
PAGE 12
Output 1:-
PAGE 13
Code 2:-
Output 2:-
PAGE 14
Experiment – 5
Aim: Use lambda functions, map, and filter to perform operations on a list.;
Create a module that contains functions for mathematical operations.;
Import and use functions from external packages (e.g., math, random)
Code 1:-
Output 1:-
PAGE 15
Code 2:-
PAGE 16
Output 2:-
PAGE 17
Code 3:-
Output 3:-
PAGE 18
Experiment – 6
Aim:- Create and manipulate Numpy arrays. Perform 4 basic operations and
indexing on arrays.
Code:-
PAGE 19
Output:-
PAGE 20