Assignment | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Assignment

In python if I ask for input and I get it, how would I assign that input a variable name?

29th Dec 2019, 12:30 PM
Anyanwu,Lofty-John
Anyanwu,Lofty-John - avatar
3 Answers
+ 3
answer = input('please, enter a number: \n') print(answer) in the variable "answer" will be stored the value entered by the user. then you can use this value
29th Dec 2019, 12:41 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
Thanks for your answer.
3rd Jan 2020, 9:12 AM
Anyanwu,Lofty-John
Anyanwu,Lofty-John - avatar
0
name=input('What is your Name? ') print(name)
7th Jul 2021, 7:53 AM
Faisal Ahmed
Faisal Ahmed - avatar