|
Download README.md from Reddy2909/calc: direct link, hf CLI and curl.
- Browser
- Download file 823 Bytes
-
https://huggingface.co/Reddy2909/calc/resolve/main/README.md
- Command line
-
hf download hf://Reddy2909/calc/README.md
-
curl -L -o README.md https://huggingface.co/Reddy2909/calc/resolve/main/README.md
823 Bytes
license: apache-2.0 ---# Function to calculate simple interest def calculate_simple_interest(principal, rate, time): # Simple Interest formula: SI = (P * R * T) / 100 simple_interest = (principal * rate * time) / 100 return simple_interest
Main function
def main(): # Input principal amount principal = float(input("Enter the principal amount: "))
# Input annual interest rate
rate = float(input("Enter the annual interest rate (in %): "))
# Input time period in years
time = float(input("Enter the time period (in years): "))
# Calculate simple interest
interest = calculate_simple_interest(principal, rate, time)
# Print the result
print(f"The simple interest is: {interest}")
Call the main function
if name == "main": main()