+ 2

PYTHON | Can you actually Change the Message in the Input Prompt Pop Up?

I created a public easy Code (see Profile) I used so you can see what I mean. So in the Introduction of the input function, they explain, that you can implement a "prompt message" that will tell the client, what kind of input the program wants. Looks something like this: Name = input("Enter your Name here:\t" ) print("Hello\t" + Name) I assumes that the Pop Up Window that asks for the Input would display said prompt text but the Text only appears in the right console/ the output So in the Output it says: Enter your Name here: Hello, ... Hope I phrased my question right! Sorry I'm completely new to this and I also don't have an IDE on my Laptop yet so all I tried it in was the SoloLearn Code Playground. Any explanation/ suggestion is welcomed! Happy Sunday, Anna

17th Jan 2021, 10:49 AM
Anna S.
Anna S. - avatar
2 Réponses
+ 6
Anna S. unfortunately, on SoloLearn you can't use promp messages. This is because SoloLearn sends your code to a server to run it, and it has no way of displaying prompt messages unless the code is fully run, and the code cannot run unless the input is provided (it is complicated when you hear it for the first time, but, think about it). See this code on how input is handled on SoloLearn https://code.sololearn.com/WhiNb9BkJUVC/?ref=app What most people do is, add comments at the top of their code on what format the input should be in. For example, the following code ` # Input format: # Your name # Your age name = input() age = input() print("Your name is", name, "and age is", age) ` So that when someone sees the code, they know how they have to enter the input
17th Jan 2021, 11:18 AM
XXX
XXX - avatar
+ 1
Ahh okay now I get it. Thank you so much for your explanation and the link to the lesson! :) have a great day.
17th Jan 2021, 11:26 AM
Anna S.
Anna S. - avatar