Simple python program

What correction should I do to run this without getting the error(User is not defined)?

User=input('Welcome to Ahmed Neurocare. What is your name?:')
print('Welcome doctor',user)

A=input('See your upcoming patients details? Answer:')
print('Wait a second doctor', A)

I tried this the same way I’ve learnt it. It works fine here.

user=input('I am python. What is your name?:')
print('Welcome', user)
lang=input('Favourite programming language?:')
print('Thats a cool', lang)

Sorry, I’m just new to this.

Make sure you have variable names consistently capitalized.

1 Like

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.


1 Like