Build an Employee Profile Generator - Step 15

Tell us what’s happening:

position = Data Analyst
salary = 75000
employee_card = f’Employee: {full_name} | Age: {employee_age} | Position: {Data Analyst} | Salary: ${75000}’

what’s up guys. any help would be appreciated. I keep getting the same error message and I don’t understand why. I keep getting told “I don’t have a variable named position assigned the value of Data Analyst”. as you can see I do. where am I going wrong? I’ve tried commas, quotes, parentheses (even when being told I’m missing them) nothing works.

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)
position = Data Analyst
salary = 75000
# User Editable Region
employee_card = f'Employee: {full_name} | Age: {employee_age} | Position: {Data Analyst} | Salary: ${75000}'
# 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/150.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

Hi @moriel9966,

Isn’t Data Analyst a string?

Happy coding

yea, I don’t understand where I’m going wrong. I’ve tried commas, quotes, a single comma, parantheses, nothing works and the error message specifically shows the ‘Data Analyst’ with little arrows under it pointing up to it saying “perhaps you missed a comma”. and its telling me I don’t have a variable with the value of Data Analyst. the Socrates dude is the guy telling me the I don’t have a variable thing.

figured it out. the instructions tell you to replace the place holders with the value of the variables but when you submit it it kicks it back with those errors. so I tried it while leaving the placeholders in place and then it said it was correct. any idea why that is? I’m here to learn and appreciate the information.

Cheers

Traceback (most recent call last):
  File "main.py", line 12
    position = Data Analyst
                    ^^^^^^^
SyntaxError: invalid syntax

This syntax error was generated because the words Data Analyst were not enclosed in quotes to indicate a string.

When that’s fixed, this error is generated because you are trying to use the string value stored in the variable position rather than the variable itself:

Traceback (most recent call last):
  File "main.py", line 15
    (Data Analyst)
     ^^^^^^^^^^^^
SyntaxError: f-string: invalid syntax. Perhaps you forgot a comma?

The only way that would work is if you replaced the brackets ([]) with curly braces ({}). A placeholder looks like this: [position], while {position} is the correct way to reference a variable inside an f-string.

Hope that helps.