0% found this document useful (0 votes)
77 views9 pages

Program:: Student Marksheet Report

The document contains summaries of several Python programs that calculate or determine various numerical results: 1) One program generates a marksheet report for a student with their subject marks, total marks, average percentage and grade. 2) Other programs calculate sale price based on cost and discount, perimeter and area of shapes like circles and rectangles, simple and compound interest, and profit/loss amounts. 3) Further programs determine estimated monthly interest (EMI) based on loan amount, interest and tenure, goods and service tax (GST) amount and total bill for an item, sum of squares of the first 100 numbers, and maximum/minimum numbers in a list.

Uploaded by

SHARVESH S
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)
77 views9 pages

Program:: Student Marksheet Report

The document contains summaries of several Python programs that calculate or determine various numerical results: 1) One program generates a marksheet report for a student with their subject marks, total marks, average percentage and grade. 2) Other programs calculate sale price based on cost and discount, perimeter and area of shapes like circles and rectangles, simple and compound interest, and profit/loss amounts. 3) Further programs determine estimated monthly interest (EMI) based on loan amount, interest and tenure, goods and service tax (GST) amount and total bill for an item, sum of squares of the first 100 numbers, and maximum/minimum numbers in a list.

Uploaded by

SHARVESH S
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
You are on page 1/ 9

STUDENT MARKSHEET REPORT

AIM:'

To write a Python program to generate the marksheet report for the given ve subject
marks.

PROGRAM:

#Get the student Roll Number


Rollnumber=input("Enter the student Roll number")
#Get the student Name
StudentName=input("Enter the student Name")
#Get the subject Marks
subject1= oat(input("Enter the English mark:"))
subject2= oat(input("Enter the Political Science mark:"))
subject3= oat(input("Enter the Psychology mark:"))
subject4= oat(input("Enter the Informatics Practices mark:"))
subject5= oat(input("Enter the Economics mark:"))
#calculate the total
total = oat(subject1+subject2+subject3+subject4+subject5)
print("Total Marks:", total)
# calculate the Average/ Overall percentage
avg=int(total/5)
print("Average/Percentage:", avg)
# Display the appropriate grade for Average
if avg>=90 and avg<=100 :
print("Grade A")
elif avg>=80 and avg<90 :
print("Grade B")
elif avg>=70 and avg<80 :
print("Grade C")
elif avg>=60 and avg<70 :
print("Grade D")
elif avg<60 :
print("Grade E")
else :
print("Invalid Input")

RESULT:
Thus the program is executed and the result is veri ed.
fl
fl
fl
fl
fl
fl
fi
fi
CALCULATION OF SALE PRICE FOR AN ITEM

AIM:

To write a Python program to calculate the sale price of an item for the given cost and
discount.

PROGRAM

# Get the costprice

costprice = oat(input("Enter the cost price:"))

# Get the discount in percentage

discount = oat(input("Enter the discount in percentage:"))

# calculate the selling price

sellingprice = costprice - (costprice*discount/100)

# Display the sellingprice

print("Selling price is:",sellingprice)

RESULT:
Thus the program is executed and the result is veri ed.
fl
fl
fi
CALCULATION FOR PERIMETER AND AREA OF SHAPES

AIM:

To write a Python program to calculate the perimeter and area of the shapes

PROGRAM:

# program to nd the area and perimeter of the shapes

import math

print("\t Calculation for area and perimeter of the shapes")

print("Enter your choice as 1/2/3/4 \n 1.Circle \n 2.Square \n 3.Rectangle \n 4.Triangle")

choice = int(input("Enter the choice: "))

if choice == 1 :

radius = int(input( "Enter the radius:"))

# To nd the perimeter of the circle

perimeter_circle = 2*3.14*radius

print("Perimeter of the circle", perimeter_circle)

# To nd the Area of the circle

area_circle = 3.14*radius*radius

print("Area of a Circle:", area_circle)

elif choice == 2 :

side = int(input("Enter the side:"))

# To nd the area of the square

area_square= side*side

# To nd the perimeter of the square

perimeter_square= 4*side

print("Area of the square:", area_square)

print("Perimeter of the square:", perimeter_square)

elif choice == 3 :

length=int(input("Enter the length:"))

breadth = int(input("Enter the breadth:"))

# To nd the perimeter of the rectangle

perimeter_rectangle=2*(length+breadth)

# To nd the area of the rectangle

area_rectangle=length*breadth

print("Area of the rectangle:", area_rectangle)

print("Perimeter of the rectangle:",perimeter_rectangle)

elif choice == 4 :

side1 = int(input("Enter the side1:"))

side2 = int(input("Enter the side2:"))

side3 = int(input("Enter the side3:"))

perimeter_triangle = int(side1+side2+side3)

side = perimeter_triangle/2

area_triangle=(side*(side-side1)*(side-side2)*(side-side3))**0.5

print("Area of the triangle:", area_triangle)

print("Perimeter of the triangle:",perimeter_triangle)

RESULT:

Thus the program is executed and the result is veri ed.


fi
fi
fi
fi
fi
fi
fi
fi
CALCULATION OF SIMPLE INTEREST AND COMPOUND INTEREST

AIM:

To write a Python program to calculate the simple and compound interest for the given
amount, period and interest.

PROGRAM

import math

# calculation of Simple Interest and Compound Interest

principal_amount= oat(input("Enter the principal Amount"))

time_period= oat(input("Enter the number of years"))

rate_of_interest= oat(input("Enter the Interest rate"))

simple_interest= oat((principal_amount*time_period*rate_of_interest)/100)

print("Simple Interest:", simple_interest)

Amount = principal_amount * (math.pow((1+rate_of_interest / 100), time_period))

Compound_amount = Amount - principal_amount

print("Compound interest is", Compound_amount)

RESULT:
Thus the program is executed and the result is veri ed.

CALCULATION OF PROFIT AND LOSS FOR THE GIVEN PRICE

AIM:

To write a Python program to calculate the pro t and loss for the given cost price and
selling price

PROGRAM

# Program to calculate the pro t and loss for thr given CP and SP

costprice= oat(input("Enter the costprice:"))

sellingprice= oat(input("Enter the Sellingprice:"))

if costprice>sellingprice :

Loss= oat(costprice-sellingprice)

print("Loss:", Loss)

elif sellingprice>costprice :

Pro t= oat(sellingprice-costprice)

print("Pro t:", Pro t)

RESULT:
Thus the program is executed and the result is veri ed.
fi
fl
fl
fi
fl
fl
fl
fl
fl
fl
fi
fi
fi
fi
fi
CALCULATION OF EMI(Estimated Monthly Interest)

AIM:

To write a Python program to calculate the EMI for the given principal amount, interest
and the tenure.

PROGRAM:

#Calculation of EMI
Amount=int(input("Enter the principal amount:"))
Annual_interest= oat(input("Enter the Annual interest:"))
Tenure=int(input("Enter the time period in years"))
tenure_in_months=Tenure*12
monthly_interest_rate=Annual_interest/(12*100)
#EMI = p * r * (1+r)^n/((1+r)^n-1)
EMI = Amount * monthly_interest_rate * (1+monthly_interest_rate)**tenure_in_months/
((1+monthly_interest_rate)**tenure_in_months-1)
print("EMI:",EMI)

RESULT:
Thus the program is executed and the result is veri ed.

CALCULATION OF GST(Goods and Service Tax)

AIM:

To write a Python program to calculate the tax(GST) for the purchased item and thus the
bill value of the item.

PROGRAM:

#Calculation of GST
item_name=input("Enter the item_name:")
price=int(input("Enter the price:"))
gst_rate= oat(input("Enter the gst rate in % : "))
cgst= oat(gst_rate/2*100)
sgst= oat(gst_rate/2*100)
print("CGST:", gst_rate/2,"%")
print("SGST:", gst_rate/2,"%")
total_value= oat(price+cgst+sgst)
print("Bill value for the item:",total_value)

RESULT:
Thus the program is executed and the result is veri ed.
fl
fl
fl
fl
fl
fi
fi
SUM OF THE SQUARE OF FIRST 100 NATURAL NUMBERS

AIM:

To write a Python program to calculate the sum of the square of first 100 natural numbers

PROGRAM:

# sum of the square of first 100 natural numbers


sum=0
for i in range(1,101) :
sum=sum+i*i
print("Sum of square of first 100 natural numbers:",sum)

RESULT:
Thus the program is executed and the result is veri ed.

MAXIMUM AND MINIMUM NUMBER IN A GIVEN LIST

AIM

To write a Python program to retrieve the largest and smallest number in a given list.

PROGRAM

# To find the largest and smallest number in a list


n=int(input("Enter the number of items to be added in the list"))
list_items=[]
for i in range(1,n+1) :
item=input("Enter the list item:")
list_items.append(item)
print(list_items)
print("Largest number in the list", max(list_items))
print("Smallest number in the list", min(list_items))

RESULT:
The program is executed and the result is veri ed.

fi

fi

THIRD LARGEST AND SMALLEST NUMBER IN A GIVEN LIST

AIM

To write a Python program to retrieve the third largest and smallest number in a given list.

PROGRAM

# To find the largest and smallest number in a list


n=int(input("Enter the number of items to be added in the list"))
list_items=[]
for i in range(1,n+1) :
item=input("Enter the list item:")
list_items.append(item)
print(list_items)
sort_list=list_items.sort()
print("Sorted list:", list_items)
print("Third largest number in the list:", list_items[-3])
print("Third smallest number in the list:", list_items[2])

RESULT:
The program is executed and the result is veri ed.

DISPLAY THE ‘N’ MULTIPLES OF A GIVEN NUMBER

AIM

To write a Python program to display the ‘n’ multiples of a given number.

PROGRAM

# To find the first 10 multiples of a given number


multiply_table=int(input("Enter the number:"))
multiple=int(input("Enter the multiple:"))
for i in range(1,multiple+1) :
multiply = i * multiply_table
print(multiply_table , "*", i, "=", multiply)

RESULT:
The program is executed and the result is veri ed.

fi
fi

DISPLAY THE NUMBER OF VOWELS IN A GIVEN STRING

AIM

To write a Python program to display the number of vowels in the given string

PROGRAM

# To count the number of vowels in a given string


user_string=input("Enter the String:")
count=0
for ch in user_string :
if ch == 'a' or ch == 'e' or ch == 'i' or ch == 'o' or ch == 'u' :
count=count+1
print("Number of vowels in the given string-",user_string, ":",count)

RESULT:
The program is executed and the result is veri ed.

DISPLAY THE NUMBER OF OCCURRENCES OF AN ALPHABET IN A GIVEN STRING

AIM

To write a Python program to count the number of occurrences of an alphabet in the


given string

PROGRAM

# To count the number of occurrences of an alphabet in a given string


user_string=input("Enter the String:")
alphabet=input("Enter the alphabet:")
c=user_string.count(alphabet, 0,len(user_string))
print("Number of alphabet”, alphabet, “ in the given string-",user_string, ":",c)

RESULT:
The program is executed and the result is veri ed.

fi
fi

ADD THE ITEMS IN DICTIONARY AS STATES AND THEIR CAPITALS

AIM

To write a Python program to add the items in the dictionary as state and their
capitals.

PROGRAM
mydict = {}
no = int(input("Enter the Number of states to be added:"))
for i in range(0,no) :
states = input("Enter the state name:")
capital = input("Enter the capital:")
mydict[states]=capital
print("Items in dictionary are:",mydict)

RESULT:
The program is executed and the result is veri ed.

DISPLAY THE HIGHEST AND LOWEST VALUES IN THE DICTIONARY

AIM

To write a Python program to retrieve the highest and lowest values in the
dictionary.

PROGRAM

mydict = {}
no = int(input("Enter the Number of items to be added:"))
for i in range(0,no) :
key= input("Enter the key:")
value = int(input("Enter the values:"))
mydict[key] = value
print("Items in dictionary are:",mydict)
values=mydict.values()
print("The highest value in the dictionary:",max(values))
print("The lowest value in the dictionary:",min(values))

RESULT:
The program is executed and the result is veri ed.

fi
fi

You might also like