- 5

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

Is this code right ?

16th May 2020, 9:15 AM
prasad jagdale
prasad jagdale - avatar
8 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
0
name = input(“Please enter you name : “) print(name)
9th Jul 2024, 7:09 AM
นูรีดา ยึรัมย์