GURU NANAK DEV ENGINEERING COLLEGE
Python Programming Laboratory
LPCIT-105
Submitted By:- Submitted To:-
Name-Vishal Kumar Prof-Rupinder Kaur
Class-D2ITB2
CRN-2021123
URN-2005002
i
INDEX
[Link] Practical Name Page no
1 Program to enter and display your name using Python
iii
2 Program to make a tax calculator using Python
iv
3 Program to find area of a rectangle using Python
v
4 Program to find area of a circle using Python
vi
5 Program to find area of a triangle using Python
vii
ii
Practical:-1
Objective:- Program to enter and display your name using Python
Code:-
print("Name:-Vishal Kumar, Class:-D2ITB2, CRN:- 2021123, URN:- 2005002")
name = input("Enter your name : ")
age = int(input("Enter your age : "))
print(name, "is",age,"years old.")
output:-
iii
Practical :-2
Objective:- Program to make a tax calculator using Python
Code:-
print("Name:-Vishal Kumar, Class:-D2ITB2, CRN:-2021123, URN:- 2005002”)
print(“TAX CALCULATOR")
grossSales = int(input("Enter gross Sales: "))
costOfGoodSold = int(input("Enter cost of good sold : "))
operatingExpense = int(input("Enter operating expense : "))
credit = int(input("Enter credit : "))
taxableAmount = grossSales - costOfGoodSold - operatingExpense - credit
print("Total Taxable Amount: ",taxableAmount)
output:-
iv
Practical :-3
Objective:- Program to find area of a rectangle using Python
Code:-
print("Name:-Vishal Kumar, Class:-D2ITB2, CRN:- 2021123, URN:- 2005002")
length = float(input("Enter length of rectangle: "))
breadth = float(input("Enter breadth of rectangle: "))
print("Area of rectangle is",length*breadth,"Square Units")
output:-
v
Practical :-4
Objective:- Program to find area of a circle using Python
Code:-
import math
print("Name:-Vishal Kumar, Class:-D2ITB2, CRN:- 2021123, URN:- 2005002")
radius = float(input("Enter radius of circle: "))
print("Area of circle is ",[Link]*(radius**2),"Square Units")
output:-
vi
Practical:-5
Objective:- Program to find area of a triangle using Python
Code:-
print("Name:-Vishal Kumar, Class:-D2ITB2, CRN:- 2021123, URN:- 2005002")
base = float(input("Enter base of triangle: "))
height = float(input("Enter height of triangle: "))
print("Area of triangle is:",1/2*base*height,"Square Units")
output:-
vii