Build an Employee Profile Generator - Step 15

Tell us what’s happening:

I’m getting a syntax error saying unterminated string literal but I did what the instructions said

Your code so far

first_name = 'John'
last_name = 'Doe'
full_name = first_name + ' ' + last_name
address = '123 Main Street'
address += ', Apartment 4B'
employee_age = 28
employee_info = full_name + ' is ' + str(employee_age) + ' years old'
print(employee_info)
experience_years = 5
experience_info = 'Experience: ' + str(experience_years) + ' years'
print(experience_info)
# User Editable Region
position = Data Analyst
salary = 75000
employee_card = f'Employee: [John Doe] | Age: [28] | Position: [Data Analyst] | Salary: $[75000
print(employee_card)]
# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36

Challenge Information:

Build an Employee Profile Generator - Step 15

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-employee-profile-generator/69727ea5c9606bedfe36d3d2.md at main · freeCodeCamp/freeCodeCamp · GitHub

Welcome to the forum @swathi.kandimalla89

The postionvariable is a string, so should begin and end with matching quote marks.

Replace the placeholders with the corresponding variables.

You need to replace the [xxx]placeholders with the corresponding variables.

Happy coding

I don’t understand. I did that that but it still says error.

Instead of

use the variable full_name

Please post your updated code.

You forgot the closing quote at the end of the string. It should be f'string', but the final ' is missing.
Also, instead of hardcoding the result, you should use variables. For example, don’t write [John Doe]; use {full_name} instead.

first_name = 'John'

last_name = 'Doe'

full_name = first_name + ' ' + last_name

address = '123 Main Street'

address += ', Apartment 4B'

employee_age = 28

employee_info = full_name + ' is ' + str(employee_age) + ' years old'

print(employee_info)

experience_years = 5

experience_info = 'Experience: ' + str(experience_years) + ' years'

print(experience_info)

position = Data Analyst

salary = 75000

employee_card = f'Employee: [full_name] | Age: [28] | 'Position: [Data Analyst]'' | Salary: $[75000

print(employee_card)]

I posted my updated code

are you sure about this line?

Hi @swathi.kandimalla89

I updated your post above so the code formats correctly on the forum.

There are two ways you can format your code to make it easier to read and test:

  1. After you copy/paste your code into the editor, select it by dragging your cursor over it then click the (</>) button in the toolbar to automatically wrap your code in backticks. (You can click on the animated demo image below to enlarge it.)

  1. Manually add three backticks on a new line above your code and on a new line after your code. Note that a backtick is NOT the same as a single quote('). To find the backtick key on your keyboard, see this post.

To see changes to your post as you make them, you can click the (M+) button on the toolbar to bring up the rich text editor:

Hi @swathi.kandimalla89

First thing, did you notice the message in the console?

Happy coding

It looks like you may have changed the starting code in areas you were not asked to change, which will cause the tests to fail. Please click the reset button to restore the original code and try again.

image

Thanks for telling me that. I am new, so I don’t know how this works

I will make sure to do that

Thanks for helping me, dhess. I solved the problem now.