On Mon, May 2, 2016 at 3:52 AM, Adam Davis wrote:
> Hi Ian,
>
> I'm really struggling to implement a set into my code as I'm a beginner,
> it's taking me a while to grasp the idea of it. If I was to show you my code
> so you get an idea of my aim/function of the code, would you be able to help
> m
potential_passengers = ['bob','john','sue','wendy','chris','bob','jen','wendy']
accepted_passengers = set()
for name in potential_passengers:
print('checking on {}...'.format(name))
if name not in accepted_passengers:
accepted_passengers.add(name)
print('welcome aboard, {}
On Apr 27, 2016 7:25 PM, "Adam Davis" 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
wrote:
> > > I understand what you're saying! But where you say: " the_set =
set()", what would go within the set brackets?
> >
> > N
On Wednesday, 27 April 2016 07:37:42 UTC+1, Chris Angelico wrote:
> On Wed, Apr 27, 2016 at 4:26 PM, Adam Davis 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 n
On Wed, Apr 27, 2016 at 4:26 PM, Adam Davis 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 a
On Tuesday, 26 April 2016 21:23:58 UTC+1, MRAB wrote:
> On 2016-04-26 21:07, Adam Davis wrote:
> > On Tuesday, 26 April 2016 20:52:54 UTC+1, Ian wrote:
> >> On Tue, Apr 26, 2016 at 1:05 PM, Joaquin Alzola
> >> wrote:
> >> > Just an example. Didn't use the csv but just hope that it helps.
> >> >
import csv
Use dictionary {key:value}
-Original Message-
From: Python-list
[mailto:python-list-bounces+joaquin.alzola=lebara@python.org] On Behalf Of
peakgraph...@gmail.com
Sent: 26 April 2016 17:01
To: python-list@python.org
Subject: Howw to prevent the duplication of any value in
On 2016-04-26 21:07, Adam Davis wrote:
On Tuesday, 26 April 2016 20:52:54 UTC+1, Ian wrote:
On Tue, Apr 26, 2016 at 1:05 PM, Joaquin Alzola
wrote:
> Just an example. Didn't use the csv but just hope that it helps.
>
> name=[]
> name_exist="Dop"
>
> with open("dop.csv") as f:
> for line
On Tue, Apr 26, 2016 at 2:07 PM, Adam Davis wrote:
> On Tuesday, 26 April 2016 20:52:54 UTC+1, Ian wrote:
>> On Tue, Apr 26, 2016 at 1:05 PM, Joaquin Alzola
>> wrote:
>> > Just an example. Didn't use the csv but just hope that it helps.
>> >
>> > name=[]
>> > name_exist="Dop"
>> >
>> > with open
On Tuesday, 26 April 2016 20:52:54 UTC+1, Ian wrote:
> On Tue, Apr 26, 2016 at 1:05 PM, Joaquin Alzola
> wrote:
> > Just an example. Didn't use the csv but just hope that it helps.
> >
> > name=[]
> > name_exist="Dop"
> >
> > with open("dop.csv") as f:
> > for line in f:
> >
On Tue, Apr 26, 2016 at 1:05 PM, Joaquin Alzola
wrote:
> Just an example. Didn't use the csv but just hope that it helps.
>
> name=[]
> name_exist="Dop"
>
> with open("dop.csv") as f:
> for line in f:
> line_split=line.split(',')
> name.append(line_strip[0])
On Tue, Apr 26, 2016 at 11:00 AM, Adam Davis wrote:
> On Tuesday, 26 April 2016 17:14:36 UTC+1, Ian wrote:
>> On Tue, Apr 26, 2016 at 10:01 AM, wrote:
>> > I am wondering how to make my code function so it does not allow any of
>> > the same values to be entered into a column in my CSV file cr
hon-list
[mailto:python-list-bounces+joaquin.alzola=lebara@python.org] On Behalf Of
Adam Davis
Sent: 26 April 2016 18:05
To: python-list@python.org
Subject: Re: Howw to prevent the duplication of any value in a column within a
CSV file (python)
On Tuesday, 26 April 2016 17:01:41 UTC+1, Adam
On Tuesday, 26 April 2016 17:01:41 UTC+1, Adam Davis wrote:
> I am wondering how to make my code function so it does not allow any of the
> same values to be entered into a column in my CSV file created through
> python. So I need to read into the CSV file and check if any names have
> already
On Tuesday, 26 April 2016 17:09:10 UTC+1, Joel Goldstick wrote:
> On Tue, Apr 26, 2016 at 12:01 PM, wrote:
> > I am wondering how to make my code function so it does not allow any of the
> > same values to be entered into a column in my CSV file created through
> > python. So I need to read in
On Tuesday, 26 April 2016 17:14:36 UTC+1, Ian wrote:
> On Tue, Apr 26, 2016 at 10:01 AM, wrote:
> > I am wondering how to make my code function so it does not allow any of the
> > same values to be entered into a column in my CSV file created through
> > python. So I need to read into the CSV
On Tue, Apr 26, 2016 at 10:01 AM, wrote:
> I am wondering how to make my code function so it does not allow any of the
> same values to be entered into a column in my CSV file created through
> python. So I need to read into the CSV file and check if any names have
> already been entered. If t
On Tue, Apr 26, 2016 at 12:01 PM, wrote:
> I am wondering how to make my code function so it does not allow any of the
> same values to be entered into a column in my CSV file created through
> python. So I need to read into the CSV file and check if any names have
> already been entered. If t
I am wondering how to make my code function so it does not allow any of the
same values to be entered into a column in my CSV file created through python.
So I need to read into the CSV file and check if any names have already been
entered. If they have, the user must not be allowed to enter thi
19 matches
Mail list logo