Home > Back-end >  Visual Studio Code
Visual Studio Code

Time:01-29

I'm getting all of this extra codeenter image description here

CodePudding user response:

You are not declaring a variable on your code.

Try this, save it and run it:

name = input('what is your name: ?')
print(name)

CodePudding user response:

Calling the input() function does not automatically create a separate variable named input, which is what you seem to expect.

You have to assign the result of the input function to a variable:

yourname = input('What is your name? ')
print(yourname)

CodePudding user response:

As Blue Acronis said, you have to save that input inside of a variable or you can do this instead:

print(input('What is your name?'))
  • Related