print(f"name = ", i + f"Yearly value = \n", yearly_value) Follow
Why is there an implicit CR + LF w/o placing a '\n' in a print statement, and why can't I attach/assign an in 'int' to a string in a print statement???
File "C:/Users/kevin/PycharmProjects/Myfuturevalue/FutureValueCal.py", line 30, in <module>
print(f"Year = ", years + f"Yearly value = \n", yearly_value)
TypeError: unsupported operand type(s) for +: 'int' and 'str'
python-BaseException
30:
print(f"Year = ", years + f"Yearly value = \n", yearly_value)
Please sign in to leave a comment.
This is an incorrect usage of f-strings. Perhaps you mean something like this: