0

How to take strings as a output from the user and assign it to a variable in python.

#I guess the code will be... x=input("enter you name:- ") print(x) # correct me where I am wrong.

23rd Jul 2018, 9:32 AM
wasif
3 Answers
+ 4
theres nothing wrong with this, variable x holds the input and then you have printed it to console using print(x)
23rd Jul 2018, 9:45 AM
D_Stark
D_Stark - avatar
+ 4
#yea its fine i used this #takes input x=input(""); #prints input print(x);
23rd Jul 2018, 10:25 AM
D_Stark
D_Stark - avatar
+ 1
you mean to say, my code is correct..?? but it's showing error, when I run it.
23rd Jul 2018, 9:47 AM
wasif