Tell us what’s happening:
I’ve tried for several hours to get past step 11, and I just can’t do it. No matter what I do, it always keeps telling me to concatenate ’ years old’ to the end of the “employee_info” variable. Am I writing the code wrong?
Your code so far
first_name = 'John'
last_name = 'Doe'
full_name = first_name + ' ' + last_name
address = '123 Main Street'
address += ', Apartment 4B'
# User Editable Region
employee_age = 28
employee_info = full_name + ' is ' + str(employee_age)
employee_info += str(' years old')
print(employee_info)
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36
Challenge Information:
Build an Employee Profile Generator - Step 11
Hi
For your employee_info variable you need to concatenate the string at the end of the existing value assigned. No need to add a new line to do it or to use a string constructor.
I know what I have to do, but haven’t I already concatenated the string? The text coming up on the console seems to be correct, so isn’t that enough for the code to be concatenated? That’s the part that’s confusing me.
Hi
Yes it is printing in the console but the way you got there isn’t what they want. It maybe that the instructions aren’t super clear on this (actually they are - the instructions say to update the value that you have already assigned to 'employee_info, so read this as not asking for more lines of code to update the variable). However to get you there, the clue above is to think how you can just do this on one line of code by adding to your existing variable to achieve it. Also, how you can do it (still on the same line of code) without using the constructor str().