首页  >  文章  >  后端开发  >  关于 EMI、BMI、SSLC %、EB Bill 计算器的 Python Day 项目

关于 EMI、BMI、SSLC %、EB Bill 计算器的 Python Day 项目

Mary-Kate Olsen
Mary-Kate Olsen原创
2024-11-19 02:54:02391浏览

Python Day roject on EMI,BMI,SSLC %,EB Bill calculator

1。 EMI计算器:

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

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

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

N = years * 12


emi = (P * R * (1 + R)**N) / ((1 + R)**N - 1)

print("your emi amount is:",emi)

如果我们输入本金金额、年利率、贷款期限的值,那么结果将是这样的,

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

2。 Sslc百分比计算:

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))

因此,对于上述语法,通过输入所有主题标记,输出将是,

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

3。 BMI计算器:

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

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


bmi = weight / (height *height)

print("your bmi is",bmi)

对于上述语法,输入体重(公斤)和身高(米)后,输出将是

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

4。 EB计算器:

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 the no of units consumed: 200
Enter the price per unit: 10
Total electricity bill: 2000.0

以上是关于 EMI、BMI、SSLC %、EB Bill 计算器的 Python Day 项目的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn