0% found this document useful (0 votes)
9 views4 pages

Python Exp1 2

The document outlines the Python Programming Lab curriculum for MCA 2nd Year students at Galgotias College of Engineering & Technology, detailing various programming experiments and objectives. It includes tasks related to input/output operations, building Python modules, data structures, exception handling, and data visualization using libraries like matplotlib and pandas. Each experiment features a problem statement, implementation details, and expected results to demonstrate the concepts learned.

Uploaded by

xdfggyz1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

Python Exp1 2

The document outlines the Python Programming Lab curriculum for MCA 2nd Year students at Galgotias College of Engineering & Technology, detailing various programming experiments and objectives. It includes tasks related to input/output operations, building Python modules, data structures, exception handling, and data visualization using libraries like matplotlib and pandas. Each experiment features a problem statement, implementation details, and expected results to demonstrate the concepts learned.

Uploaded by

xdfggyz1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like