DEV Community

Guru prasanna
Guru prasanna

Posted on

Python Day 4-Project on EMI,BMI,SSLC %,EB Bill calculator

1. EMI calculator:

principal = float(input("Enter the loan amount Principal: "))

annual_rate = float(input("Enter the annual interest rate: "))
Rate_of_interest = (annual_rate / 100) / 12

years = int(input("Enter the loan tenure: "))

No_of_years = years * 12


emi = (principal * Rate_of_interest * (1 + Rate_of_interest)**No_of_years) / ((1 + Rate_of_interest)**No_of_years - 1)

print("your emi amount is:",emi)
Enter fullscreen mode Exit fullscreen mode

If we enter the values of principal amount,rate of annual interest,tenure of the loan then the result will be like this,

Enter the loan amount Principal: 100000
Enter the annual interest rate: 10
Enter the loan tenure: 10
your emi amount is: 1321.5073688176194

Enter fullscreen mode Exit fullscreen mode

2. Sslc percentage calculation:

tamil = input("Tamil Mark please: ")
english = input("English Mark please: ")
maths = input("Maths Mark please: ")
science = input("Science Mark please: ")
social = input("Social Mark please: ")
print(int(tamil) + int(english) + int(maths) + int(science) + int(social))

total=int(tamil) + int(english) + int(maths) + int(science) + int(social)
print("Your overall marks percentage is",(total/500*100))

Enter fullscreen mode Exit fullscreen mode

So for the above syntax by entering all subject marks then the output will be,

Tamil Mark please: 83
English Mark please: 89
Maths Mark please: 83
Science Mark please: 95
Social Mark please: 90
440
Your overall marks percentage is 88.0

Enter fullscreen mode Exit fullscreen mode

3. BMI calculator:

def calculate_bmi(weight,height):
    bmi=weight/(height*height)
    return bmi

weight=int(input("Enter your weight in kg:"))
height=float(input("Enter your height in meters:"))

total=calculate_bmi(weight,height)

print("your bmi is: ",total)

Enter fullscreen mode Exit fullscreen mode

For the above syntax after entering weight(kg) and height(meters) then the output will be

Enter your weight in kg: 70
Enter your height in meters: 1.68
your bmi is 24.801587301587304

Enter fullscreen mode Exit fullscreen mode

4. EB calculator:

def calculate_bill(units,price_per_unit):
    bill=units*price_per_unit
    return bill

units=float(input("Enter the no of units consumed: "))
price_per_unit=float(input("Enter the price per unit: "))

total_bill=calculate_bill(units,price_per_unit)
print("Total electricity bill:",total_bill)

Enter fullscreen mode Exit fullscreen mode

After entering no of units consumed and price per unit the output will be,

Enter the no of units consumed: 200
Enter the price per unit: 10
Total electricity bill: 2000.0

Enter fullscreen mode Exit fullscreen mode

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay