[Tutor] Python question
David Rock
david at graniteweb.com
Mon Nov 2 21:56:56 EST 2020
> On Nov 2, 2020, at 04:44, Mark Lawrence <breamoreboy at gmail.com> wrote:
>
> On 02/11/2020 07:58, jasmine wrote:
>> Hi,
>> I was wondering how can I allow a user to input an arbitrary number of
>> names? (im using the version 2020.2.1)
>> thank you.
>
> As we don't write your code you'll need to read the names and append them to a list. From the index here https://docs.python.org/3/genindex.html you should be able to find 'input', 'while' and 'list'. You're not using Python 2020.2.1 as the latest version is 3.9.0, I'd guess that's your IDE you're referring to.
2020.2.1 sounds like the version of PyCharm.
As Mark suggests, you will want to investigate using a loop to repeatedly ask for names and append them to a list that you can work with after you break out of the loop.
That may not be the best solution, depending on your needs, but it’s a good place to start.
—
David Rock
david at graniteweb.com
More information about the Tutor
mailing list