Hello,

I am new to python.

I am trying to run this python program using xampp.

first.py

print('Interest Calculator:')
amount = float(input('Principal amount ?'))
roi = float(input('Rate of Interest ?'))
years = int(input('Duration (no. of years) ?'))
total = (amount * pow(1 + (roi/100), years))
interest = total - amount
print('\nInterest = %0.2f' %interest)

I wonder why it showing me the whole text ? Looks like I am missing something.

Please explain. When I ran it with some numbers, my output was

Interest = 1976.07

What were you expecting?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.