0

Problem with Sololearn python input

I was doing code playground, making some basic inputs, playing around with the code so I decided to insert this print("Welcome") name = input("What is your name?") Family_name = input("What is your family name?") print("Oh hello," + name + " " + Family_name) Obviously this would ask for the input of your family name and name and print it out by saying Oh hello, (name) (family name or surname). Instead it actually printed the entire input with it. With “what’s your name” and more. Any ideas?

6th Jul 2024, 6:42 PM
[Astro E] 王李
[Astro E] 王李 - avatar
2 odpowiedzi
+ 3
John , if you input `Ringo` as the first name, and `Starr` as the family name, you may get something like this: Welcome what is your name?what is your family name?0h hello,Ringo Starr > the reason is the behaviour of the sololearn playground. it is console based and the code will be executed on the sololearn server. to do so, all inputs have to be given in advance, so the playground is not working interactively as you may expect.
6th Jul 2024, 7:18 PM
Lothar
Lothar - avatar
0
I suspected that, sololearn sandbox is more dependent on things like user input rather than individual input like with real apps that require things that are the formst im used to. Thank you!
6th Jul 2024, 7:21 PM
[Astro E] 王李
[Astro E] 王李 - avatar