Skip to Main Content
Blog

Calculate Sum of all Denominations in Python

Calculate Sum of all Denominations in Python

def main():
    """
    Finds the sum of the denominations of a given amount.
    """

    n010 = int(input("Enter number of  ₹10 notes: "))
    n020 = int(input("Enter number of  ₹20 notes: "))
    n050 = int(input("Enter number of  ₹50 notes: "))
    n100 = int(input("Enter number of ₹100 notes: "))
    n200 = int(input("Enter number of ₹200 notes: "))
    n500 = int(input("Enter number of ₹500 notes: "))

    amt = n010 * 10 + n020 * 20 + n050 * 50 + n100 * 100 + n200 * 200 + n500 * 500

    print(f"₹{amt}")


if __name__ == "__main__":
    main()