Step-by-step explanation:
# Ask the user for the number of days
days = int(input("How many days would you like to work? "))
# Set initial values
day = 1
totalPay = 0
# Print the table header
print('Day\t\tSalary\t\tCumulative Pay')
# Calculate the salary and cumulative pay for each day
while day <= days:
salary = (2**(day-1))/100
totalPay += salary
print(str(day) + '\t\t$' + str(salary) + '\t\t$' + str(totalPay))
day += 1
# Show the message if the cumulative pay is more than $5000
if totalPay >= 5000:
print('It is worth earning pay at this rate if you work for at least',
str(day-1), 'days because you just made $' + str(totalPay))
# Show the total pay in a dollar amount
totalPay = totalPay/100
print('\\The total pay is $' + str(totalPay))