1

Date-Time Manipulation

Unsolved
Data Wrangling

Difficulty: 3 | Problem written by ankita
Manipulating the date and time is a very important and frequently used concept in the field of data science. A data scientist should be able to manipulate the date and time to suit the needs of the problem. Python provides a separate module for this called "datetime".

The datetime module provides a number of functions to deal with dates, times, and time intervals. We are going to use the module by applying it to a simple problem of calculating simple interest:

Simple interest is a way of calculating the interest charge on a loan. It is calculated by multiplying the daily interest rate by the principal amount by the number of days that elapse between payments.

The final amount that has to be paid is calculated by adding simple interest to the principal amount.

Input:

Bill_Date: The date on which invoice was generated (str) (dd-mm-yy)

Grace_days: The grace amount of days that is being provided and no interest will be calculated for the grace days (int)

Payment_received_date: The date on which payment was received (str) (dd-mm-yy)

Bill_amount: The principal amount (int)

Interest_rate: Rate at which interest is calculated

Output: 

The total amount to be paid back(bill_amount+interest on bill_amount)

Hint:

You'll have to import date, time, timedelta from datetime.

You'll have to import datetime.

SI=\(\tfrac{P*R*T}{100}\)

T = No. of days elapsed between "payment_received_date" and "bill_date" minus "grace_days"

Sample Input:
<class 'str'>
bill_date: 01/04/21
<class 'int'>
grace_days: 10
<class 'str'>
payment_received_date: 01/05/21
<class 'int'>
bill_amount: 10005
<class 'int'>
interest_rate: 15

Expected Output:
<class 'float'>
18228.287671232876

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Minus nam nesciunt minima, culpa libero et aspernatur quas perspiciatis sint quam illo voluptatem reiciendis, distinctio cumque sequi nam sit laudantium quisquam veritatis totam assumenda dolor?

Ratione doloribus atque quos officia, beatae accusamus reiciendis consectetur veritatis asperiores perspiciatis possimus tempora, atque tempora sunt provident modi totam corrupti dolore fuga quasi rerum laboriosam, ratione illo atque harum, ab quibusdam suscipit delectus maxime commodi voluptatem?

Commodi iusto optio soluta aliquam consequuntur delectus facilis repellat omnis magnam architecto, quos eum repellendus delectus officiis at cum laudantium a voluptas, fugiat ea exercitationem porro totam velit modi molestias, veritatis omnis eveniet quia tempore, nesciunt quae corrupti harum eligendi quidem repudiandae error. Tenetur doloremque est itaque maxime, odit reiciendis esse voluptatem sunt eligendi culpa praesentium ut mollitia, suscipit odit explicabo vitae blanditiis non ipsa amet maxime consectetur dolor, modi debitis quaerat. Facere neque hic unde harum exercitationem odit, hic beatae dignissimos? Saepe autem doloribus repellendus nulla assumenda reprehenderit sunt ipsum recusandae, eius quidem atque blanditiis sunt delectus.

This is a premium feature.
To access this and other such features, click on upgrade below.

Ready.

Input Test Case

Please enter only one test case at a time
numpy has been already imported as np (import numpy as np)