Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #107723
| From | Andrew Ongko <andrew.ongko@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Howw to prevent the duplication of any value in a column within a CSV file (python) |
| Date | 2016-04-27 19:57 +0700 |
| Message-ID | <mailman.147.1461761880.32212.python-list@python.org> (permalink) |
| References | (10 earlier) <mailman.143.1461739050.32212.python-list@python.org> <75d2b984-0a1e-42fa-bb3d-f698d4f5e0a1@googlegroups.com> <CACfV+Gxvma-6vvqqxXtSL0uv7P9uhJaiXF+t-yXq-TSdLHCTUA@mail.gmail.com> <CACfV+Gxrqgk+Z9CobZ38vvDuAh=THhdfsganOht+Sj4vfRkgHw@mail.gmail.com> <CACfV+GwKbNx4r=3xybisiwtqHSJtFEnz5Kzh8a+MXfecYAYgHg@mail.gmail.com> |
On Apr 27, 2016 7:25 PM, "Adam Davis" <peakgraphicz@gmail.com> wrote:
>
> On Wednesday, 27 April 2016 07:37:42 UTC+1, Chris Angelico wrote:
> > On Wed, Apr 27, 2016 at 4:26 PM, Adam Davis <peakgraphicz@gmail.com>
wrote:
> > > I understand what you're saying! But where you say: " the_set =
set()", what would go within the set brackets?
> >
> > Nothing. The empty parentheses mean "call this with no arguments", and
> > when you call the set constructor like that, you get back an empty
> > set.
> >
> > ChrisA
>
> Thanks Chris. Where Ian says 'the_set.add(item)', what would be put
within item in terms of my codes function/aim?
item is name in your case. Since it's the one you care about existing or
not.
It would be like:
Read from csv,
For each row, the_set.add(name)
Now that you have the_set in memory, whenever you want to check whether a
particular name has taken the quiz, just do:
if name in the_set:
# forbid
else:
# allow
Regards,
Andrew
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Howw to prevent the duplication of any value in a column within a CSV file (python) peakgraphicz@gmail.com - 2016-04-26 09:01 -0700
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Joel Goldstick <joel.goldstick@gmail.com> - 2016-04-26 12:08 -0400
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Adam Davis <peakgraphicz@gmail.com> - 2016-04-26 10:05 -0700
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-04-26 20:10 -0400
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Ian Kelly <ian.g.kelly@gmail.com> - 2016-04-26 10:13 -0600
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Adam Davis <peakgraphicz@gmail.com> - 2016-04-26 10:00 -0700
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Ian Kelly <ian.g.kelly@gmail.com> - 2016-04-26 13:50 -0600
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Adam Davis <peakgraphicz@gmail.com> - 2016-04-26 10:05 -0700
RE: Howw to prevent the duplication of any value in a column within a CSV file (python) Joaquin Alzola <Joaquin.Alzola@lebara.com> - 2016-04-26 19:05 +0000
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Ian Kelly <ian.g.kelly@gmail.com> - 2016-04-26 13:51 -0600
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Adam Davis <peakgraphicz@gmail.com> - 2016-04-26 13:07 -0700
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Ian Kelly <ian.g.kelly@gmail.com> - 2016-04-26 14:19 -0600
Re: Private message regarding: Howw to prevent the duplication of any value in a column within a CSV file (python) Ian Kelly <ian.g.kelly@gmail.com> - 2016-05-02 07:47 -0600
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) MRAB <python@mrabarnett.plus.com> - 2016-04-26 21:23 +0100
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Adam Davis <peakgraphicz@gmail.com> - 2016-04-26 23:26 -0700
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Chris Angelico <rosuav@gmail.com> - 2016-04-27 16:37 +1000
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Adam Davis <peakgraphicz@gmail.com> - 2016-04-27 05:23 -0700
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Andrew Ongko <andrew.ongko@gmail.com> - 2016-04-27 19:57 +0700
Re: Howw to prevent the duplication of any value in a column within a CSV file (python) darnold <darnold992000@yahoo.com> - 2016-04-27 08:49 -0700
RE: Howw to prevent the duplication of any value in a column within a CSV file (python) Joaquin Alzola <Joaquin.Alzola@lebara.com> - 2016-04-26 16:07 +0000
csiph-web