Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 1
Custom input message in Py 3?
How would one go about customizing the input prompt in Python 3 & up, if not via the Sololearn app, maybe on the python IDLE? I'm trying to figure out how to print something like "Enter x information : " when I request user input, example: x = int(input()) How can I make it clear to the user I'm asking for a number?
15 Respostas
+ 5
You may clear this as :
Number = int(input("Enter the number : " ))
Your output will be,
Enter the number :
+ 6
ā thanks Kishalaya Saha š«iYkE4LIFEš«
+ 5
Actually first comment i wrote by mistakenly so sorry for that.
I corrected it. See again
Sorry to make misunderstanding. ššš
+ 5
Bipin Tatkare - (B. R. T)
I can see now that you've put the colons inside the quotes in the code, and edited your original comment as well. This is exactly what š«iYkE4LIFEš« and I were trying to suggest. š
+ 4
Quinton B. Note that you can't customize it on sololearn but Bipin Tatkare - (B. R. T) is this not the correct way??..ššš
Number = int(input("Enter the number: "))
+ 4
Bipin Tatkare - (B. R. T) the semi-colon should be inside the double quote....
+ 4
Bipin Tatkare - (B. R. T)
I, too, don't think it's okay to put the colon outside the quotes in the input prompt. Which version of Python are you using?
+ 4
Bipin Tatkare - (B. R. T) you're welcome..āā Kishalaya Saha thanks for the clarification.. šš
+ 3
Bipin Tatkare - (B. R. T) ohh...really?? Okay..š
+ 3
Kishalaya Saha I m using PyCharm
+ 3
Ok wait Kishalaya Saha
+ 2
It is not required that semicolon should be in the double quote... š«iYkE4LIFEš«
+ 2
Yeah bro š«iYkE4LIFEš« šš
+ 2
Bipin Tatkare - (B. R. T) PyCharm is not a version of Python. I ran your code in Python 3.7, and it gave me syntax error.