I made a Python program to calculate price based on Inflation Rate I made a program that calculates how much the value of money has decreased due to inflation over a given set of years.
This takes a principal amount, a start and end date, and with the help of the inflation rate, it calculates how much the value of money is at the current year. (compound)

The data from the CSV file is taken from here

Here is the code- 

import pandas

startDate = input("Enter the starting year ")
endDate = input("Enter the ending year ")

principal_amt = float(input("Enter the amount "))
startDate = startDate + "-12-" + "31"
endDate = endDate + "-12-" + "31"
final_amt = 0

print(startDate, endDate)

df = pandas.read_csv("india-cpi.csv")
df = df.set_index("date")

inflation_list = list(df.loc[startDate:endDate, " inflation-rate"])
print(inflation_list)

list_for_p = []
for item in inflation_list:
    principal_amt += principal_amt*(item/100)
    list_for_p.append(principal_amt)

print(list_for_p)
final_amt += principal_amt
print(final_amt)


This is how the output looks like: 
Enter the starting year 2016 
Enter the ending year 2018 
Enter the amount 100 
2016-12-31 2018-12-31 
[4.941, 2.4909, 4.8607] 
[104.941, 107.554975369, 112.782900056761] 
112.782900056761

I want to ask if my calculation is correct and if you have any other suggestion then please give me. It will be helpful. Thanks!
The code itself is clear enough, the spacing and variable naming is ok. You mix camelCase and snake_case. Stick to one. PEP-8 advises snake_case for function and variable names and PascalCase for classes.

Only the abbreviation of principal_amt is rather futile. Just use the full name, it costs 3 characters more.

functions

You better separate your program in functions:


read the data
get the user input
calculate the difference
present the results


That way your program is easier to understand, test and reuse

My rule of thumb on where to split the program, is on where data is exchanged from one part to another.

testing

Now you've separated your program in logical blocks, you can start testing the individual parts.

read the data

Make a small function, passing in the filename as argument and getting the index per year back. Here you can use pandas further. For starters, you can make the year a pandas.Period, so you can index the year immediately. Then you can do the division by 100 already. Since pandas has a nice cumprod function, you can already add 1 to each index

def get_inflation_rate(
    filename: typing.Union[Path, str, typing.IO]
) -&gt; pd.Series:
    """Read the inflation data from `filename`"""
    inflation_rate = (
        pd.read_csv(
            data_file,
            skiprows=16,
            parse_dates=["date"],
            usecols=[0, 1],
            index_col=0,
        )
        .div(100)
        .add(1)
        .rename(columns={" Inflation Rate (%)": "inflation_rate"})
    )["inflation_rate"]
    inflation_rate.index = inflation_rate.index.to_period()
    return inflation_rate


This returns a Series with the year as index and the inflation ratio as value

date
1960    1.017799
1961    1.016952
1962    1.036322
1963    1.029462
...
2014    1.063532
2015    1.058724
2016    1.049410
2017    1.024909
2018    1.048607
Freq: A-DEC, Name: inflation_rate, dtype: float64


I included a docstring and typing information so the user of this function and his IDE can know what to expect. 

user input

If your user returns some nonsense, your program will do little useful. Better to warn the user as clearly as possible. You can define a function like this:

def get_input(
    *, message, possible_values: typing.Optional[typing.Collection[str]] = None
) -&gt; str:
    while True:
        value = input(message)
        if possible_values is None or value in possible_values:
            return value
        print("Not one of the possibilities")


A more generic one, which can also convert to float if needed can look like this:

T = typing.TypeVar("T")


def get_input(
    *,
    message: str,
    possible_values: typing.Optional[typing.Collection[T]] = None,
    converter: typing.Optional[typing.Callable[[str], T]] = None,
) -&gt; typing.Union[T, str]:
    """Get and convert the user input.

    Tries to call `converter` on the input value.
    If this raises a `ValueError`, asks again.

    If `possible_values` is defined, checks whether the returned value is in
    this collection. If it is not, asks again.

    Args:
        message (str): The message to present to the user.
        possible_values (typing.Collection[T], optional):
            A selection which must contain the user input. Defaults to None.
        converter (typing.Callable[[str], T], optional):
            A function to try to convert the user input. Defaults to None.

    Returns:
        typing.Union[T, str]: The converted user input.

    """
    while True:
        value = input(message)
        if converter is not None:
            try:
                value_converted = converter(value)
            except ValueError:
                print("Invalid value")
                continue
        else:
            value_converted = typing.cast(T, value)
        if possible_values is None or value_converted in possible_values:
            return value_converted
        print("Not one of the possibilities")


calculate the difference

Since you have a series with all the inflation ratios already with periods as index, this becomes easy calculate the cumulative product, or even accept datetime.datetime objects as arguments.

import datetime
def calculate_inflation(
    amount: float,
    start: typing.Union[datetime.datetime, str],
    end: typing.Union[datetime.datetime, str],
    inflation_rates: pd.Series,
) -&gt; typing.Tuple[float, typing.Dict[str, float]]:
    inflation_over_period = inflation_rates[start:end]

    return (
        amount * inflation_over_period.product(),
        {
            str(year): amount * index
            for (year, index) in inflation_over_period.cumprod().iteritems()
        },
    )


bringing it together:

if __name__ == "__main__":
    data_file = Path("&lt;my path&gt;")
    inflation_rates = get_inflation_rate(data_file)
    start_year = get_input(
        message="Enter the starting year:",
        possible_values=set(inflation_rate.index.map(str)),
    )
    end_year = get_input(
        message="Enter the ending year:",
        possible_values={
            year for year in inflation_rate.index.map(str) if year &gt; start_year
        },
    )
    amount = get_input(message="Specify the amount:", converter=float)
    print(
        calculate_inflation(
            amount=amount,
            start=start_year,
            end=end_year,
            inflation_rates=inflation_rates,
        )
    )