I keep getting a error for adding strings and integers together. how can I fix this? It is in the line hours.append(hWork + "\n")

while True:
    employee=raw_input("\nPlease enter the employees' first and last name. ")
    hWork=int(raw_input("How many hours did they work this week? "))
    if hWork < 1 or hWork > 60:
        print "Employees' can't work less than 1 hour or more than 60 hours!"
        pRate=int(raw_input("What is their hourly rate? "))
        if pRate < 6 or pRate > 20:
            print "Employees' wages can't be lower than $6.00 or greater than $20.00!"
            hours.append(hWork + "\n")
            empDone = ""
            empDone = raw_input("Type DONE when finished with employees' information. ")
            if empDone == "DONE":

this is the error i am getting.

Traceback (most recent call last):
File "C:/Users/Office/Desktop/py.py", line 32, in <module>
hours.append(hWork + "\n")
TypeError: unsupported operand type(s) for +: 'int' and 'str'

'\n' is not number like error says. Also work times do not contain newlines.

Edited 6 Years Ago by pyTony: n/a

This question has already been answered. Start a new discussion instead.