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中文網其他相關文章!