Python 3.10 Input() function not working?

Viewed 43

My code is as follows:

name = input("Bartolo")
print("Hello, " + name)

Output:

Bartolo

Idk what I'm doing wrong. If I take away the input() function then it works fine.

1 Answers

You either want to do this:

# use the input statement to get the name and assign to the name variable
name = input()
print("Hello, " + name)

or this:

# assign a value to the name variable
name ="Bartolo"
print("Hello, " + name)
Related