Question : Input after all prompts in python

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Jun 11 07:16:39 EDT 2018


On Mon, 11 Jun 2018 01:44:19 -0700, mohan4h wrote:

> Everyone,
> 
> I am very new to python. I am trying to achieve the below in it, but i
> am unable to find suitable documentation to guide me on the same.
> 
> I want to prompt 3 questions together and then get input for the first
> question next to question as below.
> 
> 1. Enter your name : _
> 2. Enter your age :
> 3. Enter your gender :
> 
> After showing the below prompts, the cursor waits in first question for
> an input.

How else do you expect to tell the three inputs apart?

But okay.


print("1. Enter your name :")
print("2. Enter your age :")
print("3. Enter your gender :")
name = input("")
age = input("")
gender = input("")



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson




More information about the Python-list mailing list