Question : Input after all prompts in python

mohan4h at gmail.com mohan4h at gmail.com
Tue Jun 12 10:12:42 EDT 2018


On Tuesday, June 12, 2018 at 7:37:25 PM UTC+8, Bart wrote:
> On 11/06/2018 12:16, Steven D'Aprano wrote:
> > 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("")
> 
> This will do the job, eventually:
> 
> print("1. Enter your name :")
> print("2. Enter your age :")
> print("3. Enter your gender :")
> name = input("")
> age = input("")
> gender = input("")
> 
> print("1. Enter your name :",name)
> print("2. Enter your age :",age)
> print("3. Enter your gender :",gender)
> 
> -- 
> bart

Everyone,

I want to thank you all for your support, As advised Steven D'Aprano and Wolfgang Maier, I tried the same code in python3 and it worked like a wonder.
I would like to thank Peter Otten for the solution.

I learned something new.

Thanks for all your support.

Regards
Mohan C



More information about the Python-list mailing list