0

I get a invalid syntax message at the beginning of input myName. I don't know why, maybe it's a settings issue, but it highlights the first letter of myName as invalid.

Does anyone know why this is happening?

  # This program says hello and asks for my name

print('Hello World')
print('What is your name?' # ask for their name
myName = input()
print('It is good to meet you,' + myName)
print('The length of your name is:')
print(len(myName))
print('What is your age?') # ask for their age
myAge = input()
print('You will be ' + str(int(pyAge) + 1) + ' in a year.')
1
  • 4
    You are missing a parantesis ) literally on the second line. Usually a Syntax error will actually happen one line before where the message says Commented Mar 29, 2020 at 18:53

1 Answer 1

1

The issue is that you forgot the closing bracket on line:

print('What is your name?' # ask for their name

it should be:

print('What is your name?') # ask for their name

Also, I have a quick tip for the last line. The same output will be produced, if you do:

print('You will be', int(myAge) + 1, 'in a year.')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.