I am trying to add a dollar sign ("$") to the users input when it asks about their savings and deposits. At the end of my script I am creating a text file with all the information, but I want the numbers to have the symbol in front of it when the file is created.
savings = int(input("How much money do you have in your savings: ")
deposits = int(input("How much money do you put in deposits: ")
from tabulate import tabulate
table = tabulate([["Name", "Last", "Age", "Company", "Hourly Rate", "Occupation", "Savings", "Deposits"],
[(name), (last_name), (age), (company), (hourly_rate), (occupation), (savings, + "$"), (deposits)]], headers = "firstrow")
I've added + "$" to the savings variable, because I thought that would work but then I would get this error:
TypeError: bad operand type for unary +: 'str'
So in conclusion, I just want it to have the dollar symbol even when the text file is created because this is a sample of what it looks like for now:
Savings Deposits
9000 900 <----Missing Dollar Sign
I hope this makes sense. Thank you.