name=input("Enter your name") print("name") | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 5

name=input("Enter your name") print("name")

Is this code right ?

16th May 2020, 9:15 AM
prasad jagdale
prasad jagdale - avatar
6 Answers
+ 4
it should be print(name) Doing print("name") makes it a string ,not a variable anymore
16th May 2020, 9:18 AM
Abhay
Abhay - avatar
+ 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
16th May 2020, 9:18 AM
Slick
Slick - avatar
+ 3
Thanks bro 💯
16th May 2020, 9:19 AM
prasad jagdale
prasad jagdale - avatar
+ 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}")
17th May 2020, 11:53 AM
Sâñtôsh
Sâñtôsh - avatar
+ 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
16th May 2020, 10:05 AM
Manish
Manish - avatar
+ 1
name=input("Enter your name: ") print(name)
19th May 2020, 3:33 AM
Ahmed Muhammed
Ahmed Muhammed - avatar