Learning programming through videos seems like a bad idea to me. Just read a regular tutorial. Once you got a hang of python, then you could research specific things that interest you.
The videos are great since they are actually lecture videos.
# Calculates the FV of an investment
# Compoud interest
def main():
print("This program calculates FV of an investment")
principal = eval(input("Enter the initial investment: "))
apr = eval(input("Enter the apr: "))
years = eval(input("Enter years of investment: "))
for i in range(years):
principal = principal * (1 + apr)
print("The value in", years, "is:", principal)
I keep getting:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
main()
File "C:/Python27/Projects/FV calculator.py", line 7, in main
principal = eval(input("Enter the initial investment: "))
TypeError: eval() arg 1 must be a string or code object
This happens whenever I enter a number in.