The code below, I am trying to convert a string to int in my give_raise method. I know it's probably something simple I am missing, but I am stumped. What would be the proper syntax to convert the string to int and add that bonus to my annual salary total?
class Employee():
"""Stores an employee's data"""
def __init__(self, first_name, last_name, annual_salary):
"""Employee values"""
self.first_name = first_name
self.last_name = last_name
self.annual_salary = annual_salary
def give_raise(self, annual_salary = 40000):
"""Sets a default salary with the option to add more"""
choice = input("Do you want to add a bonus to the annual salary of more than 5000 dollars? y\n")
if choice == 'n':
annual_salary += 5000
else:
bonus = input("Please enter your bonus amount: ")
int(bonus)
annual_salary + bonus = annual_salary
print(annual_salary)
my_Employee = Employee('Harry', 'Scrotum', 40000)
my_Employee.give_raise()