- 5
name=input("Enter your name") print("name")
Is this code right ?
8 Answers
+ 4
it should be print(name)
Doing print("name") makes it a string ,not a variable anymore
+ 3
It will work but its not right.
Anything in quotes is considered a string. Even if its a variable name.
UNLESS its an fstring but thats another thing
+ 3
Thanks bro đŻ
+ 2
It will print name only not any name i.e prasad.
So you should write this in python 3 as bellowđđ
print (name)
print (f"{name}")
+ 1
name = input ("Enter your name")
# suppose you entered Prasad
print("name")
# this will print name
print(name) or,
print (f"{name}")
# this will print actual value stored in name variable i.e Prasad
Outputs :
name
Prasad
Prasad
+ 1
name=input("Enter your name: ")
print(name)
0
name = input(âPlease enter you name : â)
print(name)