GALGOTIAS COLLEGE OF ENGINEERING & TECHNOLOGY,
GR. NOIDA
Approved by AICTE, New Delhi
Affiliated to Dr. A.P.J. Abdul Kalam Technical University
(AKTU), Lucknow
PYTHON PROGRAMMING LAB (BMC 351)
MCA 2nd Year III Semester
Submitted to: Submitted By:
Ms. Suhani Srivastava Nishant Raj
Mr. Harish Bedi AKTU Roll No:2400970140102
(Assistant Professor) Section: B1
MCA Department
INDEX
PYTHON PROGRAMMING LAB
Date of Date of
S.No Objective of the Experiment Sign
Implementation Submission
1 Program based on Input Output
Programs based on the concepts of Building
2 Python Modules, Obtaining user Data,
Printing desired output.
Programs based on the concepts of:
3 Conditional if statements, Nested if
statements, Using else if and elif
Programs based on the concepts of Iteration
using different kinds of loops, Usage of
4 Data Structures: Strings, Lists, Tuples, Sets,
Dictionary
Program to create Student Report Card
5
Generator
Program based on the concepts of User-
defined modules and Standard Library
6
(random, numpy, scipy, sys, Math Module,
String Module, List Module).
Program to calculate and display the total
7
bill for items using user input.
8 Program based on Exception Handling
9 Program based on Simple Data Analysis
10 Program based on Pandas.
Weekly Temperature Data Analysis and
11
Visualization
Program to visualize monthly sales data
12
using a bar chart with the matplotlib library.
Program to display the percentage
13 distribution of expenses in different
categories using a matplotlib pie chart.
Program to develop an employee payroll
14
system using single inheritance.
15
16
EXPERIMENT 1
Objective: Program based on Input Output.
Problem Statement:
Write a Python program to demonstrate basic input and output operations by accepting a
user’s name, age, and height, then displaying the collected information using both standard
print statements and formatted output with f-strings.
Program Implementation:
# Demonstrating Input and Output in Python
# Taking different types of inputs
name = input("Enter your name: ")
age = int(input("Enter your age: "))
height = float(input("Enter your height in meters: "))
# Displaying the collected information
print("\n--- Student Information ---")
print("Name:", name)
print("Age:", age)
print("Height:", height, "meters")
# Using f-string for formatted output
print(f"\nHello {name}! You are {age} years old and {height:.2f} meters tall.")
OUTPUT:
Result:
The program successfully collected user input (name, age, height) and displayed it using
both standard print statements and formatted output, demonstrating correct application of
input/output operations and type conversion.
EXPERIMENT 2
Objective: Programs based on the concepts of Building Python Modules, Obtaining user
data & Printing desired output.
Problem Statement:
The task is to write a Python program using a user-defined module to accept a person’s first
name, last name, and age in years, then display their full name, age in years, and equivalent
age in months.
Program Implementation:
# mymodule.py
def full_name(first, last):
return f"{first} {last}"
def age_in_months(age_years):
return age_years * 12
# main.py
import mymodule # user-defined module
# Taking user input
first = input("Enter your first name: ")
last = input("Enter your last name: ")
age = int(input("Enter your age in years: "))
# Using functions from user-defined module
name = mymodule.full_name(first, last)
months = mymodule.age_in_months(age)
# Printing the desired output
print("\n--- User Details ---")
print(f"Full Name : {name}")
print(f"Age in Years : {age}")
print(f"Age in Months : {months}")
Output:
Result:
The program successfully accepted user details, used a user-defined module to compute
and display full name and age in months, fulfilling the objective of modular programming
and code reusability.