Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can post a code but afraid of plagiarism

276 views
Skip to first unread message

indar kumar

unread,
Jan 18, 2014, 5:21:42 PM1/18/14
to
Hi,

I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Roy Smith

unread,
Jan 18, 2014, 5:27:08 PM1/18/14
to
In article <e646d6f1-ac3c-4d55...@googlegroups.com>,
You can't. This is a public forum. One of the reasons people are
willing to answer basic questions is because they knew more than one
person will benefit from the answer.

indar kumar

unread,
Jan 18, 2014, 5:32:21 PM1/18/14
to
@Roy Smith

Can you help me privately because its an assignment and have to submit plagiarism free

Roy Smith

unread,
Jan 18, 2014, 5:35:13 PM1/18/14
to
In article <bb64743c-b470-4bd0...@googlegroups.com>,
indar kumar <indark...@gmail.com> wrote:

> @Roy Smith
>
> Can you help me privately

Sorry, no.

Chris Angelico

unread,
Jan 18, 2014, 5:42:59 PM1/18/14
to pytho...@python.org
On Sun, Jan 19, 2014 at 9:32 AM, indar kumar <indark...@gmail.com> wrote:
> @Roy Smith
>
> Can you help me privately because its an assignment and have to submit plagiarism free

Are you sure the requirement precludes you posting your code? More
likely, the rule is that you may not copy someone else's. When it's
posted here, it'll have your name associated with it, so anyone
checking for your code on the web will see that you posted it
yourself.

But please, before you post your code, fix your posts. You're using
the buggiest client known to this list: Google Groups. Using a
different means of posting is probably the best solution, but failing
that, you could search the web for 'Google Groups Python' and find
some useful instructions. (I'd like to see that you're able to find
things based on web search results, because that's an important
skill.)

ChrisA

Ben Finney

unread,
Jan 18, 2014, 5:57:52 PM1/18/14
to pytho...@python.org
indar kumar <indark...@gmail.com> writes:

> I want to show a code for review but afraid of plagiarism issues.

Why? What solid basis do you have to fear someone plagiarising code that
you want reviewed?

There is already a vast amount of code licensed freely for anyone to use
and derive from. What would make yours especially susceptible to
copying?

As you can tell, I strongly suspect your fears are ungrounded. You will
benefit greatly by sharing your code here and likewise benefiting from
others sharing here.

> Kindly, suggest how can I post it for review here without masking it
> visible for public

No. This forum is for the benefit of everyone who reads it, and we all
contribute on that basis.

If you want private help, you'll need to find, and provide appropriate
compensation to, someone who is willing to benefit only you.

--
\ “No matter how cynical you become, it's never enough to keep |
`\ up.” —Jane Wagner, via Lily Tomlin |
_o__) |
Ben Finney

Ben Finney

unread,
Jan 18, 2014, 5:59:23 PM1/18/14
to pytho...@python.org
indar kumar <indark...@gmail.com> writes:

> Can you help me privately because its an assignment and have to submit
> plagiarism free

Then the point of the assignment is defeated by seeking help here.

Hopefully your instructors also read this forum and are now aware you
are seeking to subvert the anti-plagiarism rules.

--
\ “It is well to remember that the entire universe, with one |
`\ trifling exception, is composed of others.” —John Andrew Holmes |
_o__) |
Ben Finney

Steven D'Aprano

unread,
Jan 19, 2014, 1:31:30 AM1/19/14
to
Then don't plagiarise.


Plagiarism means YOU copy other people. You shouldn't get in trouble
because other people copy you.

Talk to your tutor or teacher and ask what the school's policy is about
asking for external help on projects. Some schools will allow it if you
explain what help you received. Some prohibit it all together.

In general, we will help with questions about Python syntax and
libraries, but we try not to write your code for you. If you make a good-
faith attempt to solve the problem, and then ask for help, we shall try
to assist. But as I said, you should find out what your school or
university's policy is.


--
Steven

Devin Jeanpierre

unread,
Jan 19, 2014, 1:45:26 AM1/19/14
to comp.lang.python
On Sat, Jan 18, 2014 at 10:31 PM, Steven D'Aprano
<steve+comp....@pearwood.info> wrote:
> Plagiarism means YOU copy other people. You shouldn't get in trouble
> because other people copy you.

Normally, both the person copying and the person who gave away their
work to be copied are punished. It simplifies figuring out who to
punish, and discourages people from enabling cheaters.

If one of their fellow students copied their assignment, they actually
likely would be in trouble, and could be expelled or failed.

-- Devin

Grant Edwards

unread,
Jan 19, 2014, 11:22:49 AM1/19/14
to
http://www.python.org/community/jobs/

I'm sure once you've agreed on contract and payment terms with whoever
you hire to do your private code review they will arrange a private
communications channel.



Dan Stromberg

unread,
Jan 20, 2014, 12:21:44 AM1/20/14
to Steven D'Aprano, Python List
On Sat, Jan 18, 2014 at 10:31 PM, Steven D'Aprano
<steve+comp....@pearwood.info> wrote:
> On Sat, 18 Jan 2014 14:32:21 -0800, indar kumar wrote:
>
>> @Roy Smith
>>
>> Can you help me privately because its an assignment and have to submit
>> plagiarism free
>
> Then don't plagiarise.
>
>
> Plagiarism means YOU copy other people. You shouldn't get in trouble
> because other people copy you.

I did a short time of teaching while I was in school. If three
students all turned in the same assignment, they all got docked
significantly. There was no "who copied off of whom?", it was
"someone shared when they shouldn't have."

Chris Angelico

unread,
Jan 20, 2014, 1:21:30 AM1/20/14
to Python List
On Mon, Jan 20, 2014 at 4:21 PM, Dan Stromberg <drsa...@gmail.com> wrote:
> I did a short time of teaching while I was in school. If three
> students all turned in the same assignment, they all got docked
> significantly. There was no "who copied off of whom?", it was
> "someone shared when they shouldn't have."

What a wonderful way to promote an attitude of "my code is MY CODE and
should never leave my sight". What a delightful way of thinking to
unleash on the world.

ChrisA

Ben Finney

unread,
Jan 20, 2014, 2:39:44 AM1/20/14
to pytho...@python.org
Teachers are asked to grade each student on how that student exercises
the relevant skills.

Sometimes the relevant skills include collaboration, in which case the
students should be expected and encouraged to base their work directly
on the work of others. In these cases, we would expect the teacher not
to discourage sharing of information.

But sometimes different skills are being examined, and the student
should be exercising skills on their own without basing it directly on
the work of others. In these cases, penalties for plagiarism are
appropriate, would you agree?

--
\ “When I wake up in the morning, I just can't get started until |
`\ I've had that first, piping hot pot of coffee. Oh, I've tried |
_o__) other enemas...” —Emo Philips |
Ben Finney

indar kumar

unread,
Jan 20, 2014, 2:55:59 AM1/20/14
to
Thanks all for help and positive comments. Actually, I tried to ask some questions but I was discouraged to do so saying that I was working on a project or some assignment. Truth be told I am stuck at one point and since I don't have experience with programming language, I have been working for it for two days but couldn't come up with some idea so posted some questions of the same format just to know whether there is particular method etc to do so. Hint would have been enough but I was strictly discouraged. You know the pain of working on assignment related to areas like socket programming and you even don't know how to use dictionaries and you are given only a week. Atleast I am trying to learn. The things that I am asking here are just basics on which my whole code would be building upon. But, as I said time is very less and have other courses also so wanted to know just the manipulation of dictionaries.

If you allow me I can post a small part of that assignment, it just requires the manipulation with dictionary which I am not getting. I am not asking to write a code for me. But a small hint would get me out of trouble.

Chris Angelico

unread,
Jan 20, 2014, 2:59:15 AM1/20/14
to pytho...@python.org
On Mon, Jan 20, 2014 at 6:39 PM, Ben Finney <ben+p...@benfinney.id.au> wrote:
> But sometimes different skills are being examined, and the student
> should be exercising skills on their own without basing it directly on
> the work of others. In these cases, penalties for plagiarism are
> appropriate, would you agree?

If Fred writes something and Bill copies it without acknowledging
Fred's work, then Bill should be penalized. That much is clear. That
aligns well with the requirement to see what each student can
accomplish, and with standard copyright law (including open source,
where requirement-to-acknowledge is a common part of both licensing
and courtesy). But why should Fred be punished? What has he done
wrong? If it can be proven that Fred wrote the code (granted, that's
hard to prove, but providing each student with a git/hg repo to push
code to every day would make it easier), he should be graded on that
code and not on the fact that someone else ripped it off.

When it's less clear who copied from whom, I can understand issuing
across-the-board penalties in the interests of fairness (and because
the effort of figuring out who wrote what isn't worth it), but I'd say
it's a compromise for simplicity rather than justifiable punishment on
someone who published code.

ChrisA

Ben Finney

unread,
Jan 20, 2014, 3:10:46 AM1/20/14
to pytho...@python.org
Chris Angelico <ros...@gmail.com> writes:

> If Fred writes something and Bill copies it without acknowledging
> Fred's work, then Bill should be penalized. That much is clear.

The situation is where a student is being examined for skills where it's
appropriate to test the student's own skill with a reasonable level of
isolation from the relevant work of others.

So questions of plagiarism aren't relevant to that aspect.

> But why should Fred be punished? What has he done wrong?

Fred has, in your example, ignored the requirements to keep his own work
on the assignment isolated from Bill.

This is harmful to the assessment of both Bill and Fred, since the
teacher has a severely lessened ability to determine both Bill's and
Fred's individual competence levels at the skill being examined.

So, to encourage both Bill and Fred to keep their work isolated and
allow their levels of competence to be assessed with confidence, they
both need to have disincentive to both copy work and allow their work to
be copied.

> When it's less clear who copied from whom, I can understand issuing
> across-the-board penalties in the interests of fairness (and because
> the effort of figuring out who wrote what isn't worth it), but I'd say
> it's a compromise for simplicity rather than justifiable punishment on
> someone who published code.

Sure. Penalising both students – or, more precisely, advertising such
penalties from the start – seems like a much more fair and effective
measure than relying on the teacher to both detect the machinations of
ingenious students and to determine who copied from whom.

--
\ “Read not to contradict and confute, nor to believe and take |
`\ for granted … but to weigh and consider.” —Francis Bacon |
_o__) |
Ben Finney

Ben Finney

unread,
Jan 20, 2014, 3:17:35 AM1/20/14
to pytho...@python.org
indar kumar <indark...@gmail.com> writes:

> Hint would have been enough but I was strictly discouraged.

You asked for private help, specifically to subvert the rules against
plagiarism you're subject to.

So no, I don't believe this modification of your request to be sincere.
You asked for help cheating, and you were refused. Please take a hint,
and do your assignment under the terms your teacher has set.

--
\ “Holy tintinnabulation, Batman!” —Robin |
`\ |
_o__) |
Ben Finney

Chris Angelico

unread,
Jan 20, 2014, 3:48:41 AM1/20/14
to pytho...@python.org
On Mon, Jan 20, 2014 at 6:55 PM, indar kumar <indark...@gmail.com> wrote:
> Actually, I tried to ask some questions but I was discouraged to do so saying that I was working on a project or some assignment. Truth be told I am stuck at one point and since I don't have experience with programming language, I have been working for it for two days but couldn't come up with some idea so posted some questions of the same format just to know whether there is particular method etc to do so. Hint would have been enough but I was strictly discouraged.
>

Here's my policy on homework. Others may vary, but you'll find a lot
will be broadly similar.

When you take a course, you should be learning, not just passing. That
means that getting someone else to do your work for you is completely
wrong, so I won't help you. But if you've put down some code and it's
not working, then by all means, ask for help with the details; it's
easy if you have an error message you don't understand (you might be
able to get that by Googling it), but a lot harder if you're getting
output you don't understand, and then it can help a LOT to have an
expert look at your code. You would need to post your code and exactly
what you're seeing as wrong (exception traceback, or "expected this
output, got this instead"); and if you make it clear up-front that
it's homework and you're looking for hints rather than an
answer-on-a-plate, I'm happy to help.

What you will find, though, is that most requests are more of the
nature of "please do my homework for me", so people are more likely to
be annoyed than helpful when they see what's obviously homework. So
you have a bit of an uphill battle just to get heard. But if you can
show that you're here to learn - and showing that you've already
written most of the code is a good way to do that - you can get help,
and often a lot of it.

ChrisA

bryan rasmussen

unread,
Jan 20, 2014, 4:19:54 AM1/20/14
to Chris Angelico, pytho...@python.org
>When you take a course, you should be learning, not just passing. That
>means that getting someone else to do your work for you is completely
>wrong, so I won't help you.

I have decided to become an MBA.



On Mon, Jan 20, 2014 at 9:48 AM, Chris Angelico <ros...@gmail.com> wrote:
On Mon, Jan 20, 2014 at 6:55 PM, indar kumar <indark...@gmail.com> wrote:
> Actually, I tried to ask some questions but I was discouraged to do so saying that I was working on a project or some assignment. Truth be told I am stuck at one point and since I don't have experience with programming language, I have been working for it for two days but couldn't come up with some idea so posted some questions of the same format just to know whether there is particular method etc to do so. Hint would have been enough but I was strictly discouraged.
>

Here's my policy on homework. Others may vary, but you'll find a lot
will be broadly similar.

When you take a course, you should be learning, not just passing. That
means that getting someone else to do your work for you is completely
wrong, so I won't help you. But if you've put down some code and it's
not working, then by all means, ask for help with the details; it's
easy if you have an error message you don't understand (you might be
able to get that by Googling it), but a lot harder if you're getting
output you don't understand, and then it can help a LOT to have an
expert look at your code. You would need to post your code and exactly
what you're seeing as wrong (exception traceback, or "expected this
output, got this instead"); and if you make it clear up-front that
it's homework and you're looking for hints rather than an
answer-on-a-plate, I'm happy to help.

What you will find, though, is that most requests are more of the
nature of "please do my homework for me", so people are more likely to
be annoyed than helpful when they see what's obviously homework. So
you have a bit of an uphill battle just to get heard. But if you can
show that you're here to learn - and showing that you've already
written most of the code is a good way to do that - you can get help,
and often a lot of it.

ChrisA

Alister

unread,
Jan 20, 2014, 4:36:38 AM1/20/14
to
General advise is post the smallest section of code that demonstrates
your problem (It does not even have to be you actual code if it
demonstrates the same issue).

It is also important to post the full trace back of any errors.
you should also try to understand these trace backs yourself they will
become easier as you progress with the language




--
Your business will assume vast proportions.

Roy Smith

unread,
Jan 20, 2014, 9:08:28 AM1/20/14
to
In article <mailman.5735.1390198...@python.org>,
That's a little harsh. Working in groups, and sharing code, are
important parts of how software gets developed today. Those
collaborative work habits should indeed be taught. But, school is also
about evaluation of progress. At the end of the class, the teacher
needs some objective way to figure out how much each student has learned
and assign a grade. It's hard to do that if people aren't handing in
assignments done individually.

Rustom Mody

unread,
Jan 20, 2014, 11:11:49 AM1/20/14
to
On Monday, January 20, 2014 7:38:28 PM UTC+5:30, Roy Smith wrote:
> Chris Angelico wrote:

> > On Mon, Jan 20, 2014 at 4:21 PM, Dan Stromberg wrote:
> > > I did a short time of teaching while I was in school. If three
> > > students all turned in the same assignment, they all got docked
> > > significantly. There was no "who copied off of whom?", it was
> > > "someone shared when they shouldn't have."
> > What a wonderful way to promote an attitude of "my code is MY CODE and
> > should never leave my sight". What a delightful way of thinking to
> > unleash on the world.

> That's a little harsh. Working in groups, and sharing code, are
> important parts of how software gets developed today. Those
> collaborative work habits should indeed be taught. But, school is also
> about evaluation of progress. At the end of the class, the teacher
> needs some objective way to figure out how much each student has learned
> and assign a grade. It's hard to do that if people aren't handing in
> assignments done individually.

This position is a repeat of the position on whether print is a good
function for students to use: wearing teacher hat and professional
programmer hat give very different desiderata.

As an example of the need for multiple hats consider this scenario:

You are interviewing a programmer for a java job. You ask the
candidate to explain quicksort. Quick is the answer: java.util.lang.sort
[Im using java as example because the sort in python is not so
explicitly a quicksort]

You would find this answer unacceptable (hopefully)

On the other hand when that same programmer were on job, if instead
of using java.util.lang.sort he spent his time implementing one, you
would be equally peeved (hopefully!)

Most people dont get that education is like a game: Some games --
meccano, lego -- can be explicitly educative but any game can be put
to educational purpose. Now you can stymie the purpose by saying: "I
find these rules arbitrary -- I refuse to play!" but that only
obstructs the process until some other rules/games are created. And
will be seen to be fruitless once you get that all education is more
or less about bigger and smaller toys, ie unreality.

"Dont copy" is standard rule in edu-institutes. It should be
understood to be arbitrary and not some fundamental moral law, just as
"Dont hand-touch the ball" is a rule in football but not basketball.

Some people actually have fun making up new games -- a hybrid of
football and basketball? More often people find it reasonable and fun
to stay within the parameters of pre-existing rules.

As for Dan's "Punish the whole coterie rather than only the copycats"
rule: as a teacher I can say that fancy rules that are non-computable
are worse than useless. So if this is more effective than the usual
"punish the copier" rule -- all power to you. The only thing I would
add is this: Please close the feedback loop; ie check whether the
rules are serving their intended purpose. Typically one finds that
beyond a point harsh rules are counterproductive. Probably related to
the fact that if your driving cycle is entirely carrot-n-stick, the
driven will become indistinguishable from mammals and repiles

At the other end of the spectrum is the interesting anecdote in "Zen
and the art of motorcycle maintenance." The author is teaching some
course and decides to abolish exams. The students who most strongly
revolt are bottom of the class -- ie those most likely to fail!!

Some more on my blog
http://blog.languager.org/2010/05/declaration-imperation-and-language.html

Terry Reedy

unread,
Jan 20, 2014, 4:56:29 PM1/20/14
to pytho...@python.org
On 1/20/2014 9:08 AM, Roy Smith wrote:

> That's a little harsh. Working in groups, and sharing code, are
> important parts of how software gets developed today. Those
> collaborative work habits should indeed be taught.

Until recently, teaching collaboration through group projects has had
the problem of leeching. Asking group members to grade each other's
participation and contributions does not work too well. My daughter ran
into this problem in her first programming class where
private-until-done 'group' work was too much her work. In her second
class, there was discussion of each other's coding problems *in the
class*, in front of the teacher, and she enjoyed that much more.

It is now possible to run collaboration through software that records
interaction. My daughter took a composition class where discussion and
review of each other's work was recorded and contributed to each
person's grade. But this was not collaborative writing, which would be
another level of interaction, and one which is common beyond college
classes.

A programming class (probably best after the first) could use a real
(meaning, used outside of classes) repository and tracker. *That* would
better prepare people for later work, whether on a job or as an
open-source volunteer.

--
Terry Jan Reedy

Steven D'Aprano

unread,
Jan 20, 2014, 7:47:41 PM1/20/14
to
An objective way to figure out individual progress is easy. It's called
an "exam" or "test". Admittedly, it's normally only practical for
examinations to last no more than a day for senior students, and an hour
or maximum two hours for junior students, and some subjects are more
easily tested this way than others. But you can still examine a lot in a
couple of hours. If you're interested in accurately measuring the
learning of individual students, there is at least one pretty damning
problem with assignments: just because student X puts his name on the
paper doesn't mean student X wrote the paper. Assignments are effectively
based on the honour system, and we know how well that works. For those
with the money to spend, you need not do a lick of work to get an A.

Perhaps that's why Harvard has just given up even trying to distinguish
the students who learn things from those who don't? Forget George Bush's
"Gentleman's C", Harvard now practically gives A's away to anyone who
shows up (and pays the fees).

http://qz.com/153694/the-most-commonly-awarded-grade-at-harvard-is-an-a/

Presumably they're protecting their business model. Students are
customers, and if your customers are paying a small fortune to attend,
they need to get something in return. Knowledge is good, but you can't
put knowledge on a CV or frame it and put it on a wall.

It would be interesting to think about the incentives which have lead to
an over-reliance on take-home assignments rather than exams, as well as
the pros and cons of one versus the other. Don't get me wrong, there are
advantages to assignments as well, but I think that the total prohibition
on collaboration is misguided. The question in my mind is how to
encourage students to learn from each other rather than to merely
mechanically copy from each other?

Relevant:

http://qz.com/157579/confession-of-an-ivy-league-teaching-assistant-heres-why-i-inflated-grades/


--
Steven

Oscar Benjamin

unread,
Jan 21, 2014, 5:32:13 AM1/21/14
to pytho...@python.org
On Tue, Jan 21, 2014 at 12:47:41AM +0000, Steven D'Aprano wrote:
> On Mon, 20 Jan 2014 09:08:28 -0500, Roy Smith wrote:
>
> > In article <mailman.5735.1390198...@python.org>,
> > Chris Angelico <ros...@gmail.com> wrote:
> >
> >> On Mon, Jan 20, 2014 at 4:21 PM, Dan Stromberg <drsa...@gmail.com>
> >> wrote:
> >> > I did a short time of teaching while I was in school. If three
> >> > students all turned in the same assignment, they all got docked
> >> > significantly. There was no "who copied off of whom?", it was
> >> > "someone shared when they shouldn't have."
> >>
> >> What a wonderful way to promote an attitude of "my code is MY CODE and
> >> should never leave my sight". What a delightful way of thinking to
> >> unleash on the world.
> >
> > That's a little harsh. Working in groups, and sharing code, are
> > important parts of how software gets developed today. Those
> > collaborative work habits should indeed be taught. But, school is also
> > about evaluation of progress. At the end of the class, the teacher
> > needs some objective way to figure out how much each student has learned
> > and assign a grade. It's hard to do that if people aren't handing in
> > assignments done individually.

I agree that it is unfortunate but there's a bit of a balancing act with this.
The problem is that there are two sometimes conflicting roles in education:
teaching and assessing. When you set assignments the students will usually
learn more if they work in groups. However at some point you need to try and
assess how much they've individually learned. I find in practice that it's
easy to tell when a student has copied someone else without really
understanding what they're doing though. Of course if they just pay someone
else to do it for them then there's not much you can do...

>
> An objective way to figure out individual progress is easy. It's called
> an "exam" or "test". Admittedly, it's normally only practical for
> examinations to last no more than a day for senior students, and an hour
> or maximum two hours for junior students, and some subjects are more
> easily tested this way than others. But you can still examine a lot in a
> couple of hours. If you're interested in accurately measuring the
> learning of individual students, there is at least one pretty damning
> problem with assignments: just because student X puts his name on the
> paper doesn't mean student X wrote the paper. Assignments are effectively
> based on the honour system, and we know how well that works. For those
> with the money to spend, you need not do a lick of work to get an A.

The real problem with exams is that exam conditions are so unrepresentative of
real work. How often do you use the internet, or documentation, or text books
etc. in your own work? How often would you have to do something without having
anyone at least to discuss the idea with?

But yes it's absolutely necessary to have some exams or else the whole system
is open to abuse.

>
> Perhaps that's why Harvard has just given up even trying to distinguish
> the students who learn things from those who don't? Forget George Bush's
> "Gentleman's C", Harvard now practically gives A's away to anyone who
> shows up (and pays the fees).

I think that's a little harsh. To say that the majority of students get an
A- or better does not mean that they give A's to "anyone who shows up". I
would expect that the majority of students at Harvard do a lot more than just
show up. (I don't know much about Harvard specifically but this is true of
most universities).

>
> http://qz.com/153694/the-most-commonly-awarded-grade-at-harvard-is-an-a/
>
> Presumably they're protecting their business model. Students are
> customers, and if your customers are paying a small fortune to attend,
> they need to get something in return. Knowledge is good, but you can't
> put knowledge on a CV or frame it and put it on a wall.
>
> It would be interesting to think about the incentives which have lead to
> an over-reliance on take-home assignments rather than exams, as well as
> the pros and cons of one versus the other. Don't get me wrong, there are
> advantages to assignments as well, but I think that the total prohibition
> on collaboration is misguided. The question in my mind is how to
> encourage students to learn from each other rather than to merely
> mechanically copy from each other?
>
> Relevant:
>
> http://qz.com/157579/confession-of-an-ivy-league-teaching-assistant-heres-why-i-inflated-grades/

I can definitely empathise with what she says. Once I started marking
assignments it quickly became apparent that my standards were higher than
those of other people. Every now and again I would mark a big assignment
and get a deluge of grief from the students who had done badly. If it's a
small assignment (say 5 students) then you can build something out of that and
spend time preparing them for future assignments. If it's a big assignment
(100+ students) then it's just a whole load of grief that no one really wants.

The problem of students giving you grief doesn't really happen with exams
because in that case if someone complains it's not you (the original marker)
who has to talk to them and remark it. Where I work they have to fill out
their feedback forms before they take the exam so they can't use that to
complain about the exam being too hard or being marked too harshly. But what
does happen is that if the average grades are too high you get in trouble for
the exam being too easy. If the grade is too low you get in trouble since
you've apparently done a bad job teaching. There's a conflict of interest
right there (being both the teacher and the examiner) and it basically results
in everything adjusting to the ability of the students rather than measuring
it objectively.

Also I don't know why the Harvard TA says that this isn't a problem in the UK.
Here in the UK the government does it with national externally marked exams:

http://www.theguardian.com/education/2012/may/01/gcse-alevels-easier-says-ofqual

I would estimate that over the past ~50 years school standards for Maths and
Physics in the UK have slipped by ~1 academic year. Perhaps that's why we make
them do 4 years at university now...


Oscar

Dan Sommers

unread,
Jan 21, 2014, 8:49:46 AM1/21/14
to
On Tue, 21 Jan 2014 10:32:13 +0000, Oscar Benjamin wrote:

> ... When you set assignments the students will usually learn more if
> they work in groups. However at some point you need to try and assess
> how much they've individually learned. I find in practice that it's
> easy to tell when a student has copied someone else without really
> understanding what they're doing though. Of course if they just pay
> someone else to do it for them then there's not much you can do...

I had a programming teacher in high school who encouraged us to work
however we wanted, individually or in groups. There were two
conditions: (1) each student had to turn in a complete assignment, and
(2) he reserved the right to question anyone about anything they turned
in. He observed us working in class enough to know whom to question. I
know that a couple of students were busted early on; I don't know how it
all turned out in the end.

Dan

Steven D'Aprano

unread,
Jan 21, 2014, 7:01:44 PM1/21/14
to
Hi Indar,

On Sun, 19 Jan 2014 23:55:59 -0800, indar kumar wrote:

> If you allow me I can post a small part of that assignment, it just
> requires the manipulation with dictionary which I am not getting. I am
> not asking to write a code for me. But a small hint would get me out of
> trouble.


In all this discussion about plagiarism, we seem to have forgotten about
you! Sorry about that.


Yes, feel free to ask your question about manipulating dictionaries, and
we will try to answer. The more general your question (in the sense of
not being specific to your project), the less you need to worry about
plagiarism.


--
Steven

Steven D'Aprano

unread,
Jan 21, 2014, 7:51:12 PM1/21/14
to
On Mon, 20 Jan 2014 18:39:44 +1100, Ben Finney wrote:

> But sometimes different skills are being examined, and the student
> should be exercising skills on their own without basing it directly on
> the work of others. In these cases, penalties for plagiarism are
> appropriate, would you agree?

How can anyone possibly agree without knowing what those penalties are,
what the definition of plagiarism being used is, and how guilt or
innocence is determined?

According to some people in a much better position to judge, significant
parts of academia has collectively gone mad over so-called plagiarism.

"I started off researching the subject of plagiarism thinking that
sensitivity on the issue was getting a little bit out of hand. What
I found when I viewed actual guidelines and articles on the subject
was just plain appalling. Academia has simply gone crazy on this
subject; not figuratively crazy, but certifiably, clinically,
sociopathically insane. I'm talking delusional, loss of contact
with reality insanity."
-- Professor Steven Dutch, University of Wisconsin

http://www.uwgb.edu/dutchs/PSEUDOSC/PlagShame.HTM

More here:

http://www.uwgb.edu/dutchs/PSEUDOSC/PlagiarNonsense.HTM

According to Dutch, the University of Phoenix academic guidelines
includes *failing to give a page number* of an otherwise fully cited
source as plagiarism.

If you read nothing else, read the second link, as Dutch gives practical
guidelines for distinguishing significant and unethical plagiarism from
insignificant and normal borrowing and sharing.


Let's take this word of advice from "Plagiarism Today":

[quote]
In the end, it comes down to the same tried and true system of
always attributing any content that you use, no matter how small,
and always showing respect for the words of others, even if you
have permission to use them.
[end quote]

http://www.plagiarismtoday.com/2008/02/20/the-obama-plagiarism-scandal/


Do you notice the assumption made? Let me highlight it for you:

THE WORDS OF OTHERS


The hidden assumption here is that *words are property*, that they belong
to whomever first publishes them. Having now written those few words,
nobody else is permitted to use those same words in the same order
without crediting me. Failure to credit me is a sin of the highest order,
enough to get you kicked out of your university, your name blackened.
Unless, of course, somebody else wrote those words before me, in which
case *my ignorance* of that earlier usage does not diminish the magnitude
of my sin. In that regard, plagiarism is rather like patent infringement.

This attitude is part of the compartmentalisation of culture into walled
gardens, where nothing can be done without the permission of the
"intellectual property owner". This is dangerous enough when it comes to
ordinary, regular language, but it is astonishingly harmful if applied to
code. It goes against the principles of openness and freedom which the
FOSS movement stands for.

Code, for the most part, is extremely cliched. Very little code is
original, and none of it is created in isolation. There are only so many
ways to walk a list, or search a body of text for a word, or calculate
the cosine of a float. You sometimes have the option of shuffling the
order of operations around a bit, or changing variable names, or slight
modifications of some algorithm. As a community, programmers may not
always share code, but they share ideas, coding idioms and algorithms.
The academic definition of plagiarism, if applied in its full and
strictest form, would essentially make coding impossible.

We do not know how strict the OP's college is about so-called plagiarism,
whether they only intend to come down on outright copying of significant
bodies of code, or whether they have a tendency to go after trivial
borrowing of simple idioms or minor duplication of insignificant portions
of the program. (If I walk a linked list using mynode = mynode.next, and
you use the same variable names, is that an indication of copying?)
Without knowing what the OP's college considers plagiarism, how can judge
the OP's reaction to it?



--
Steven

Steven D'Aprano

unread,
Jan 21, 2014, 7:51:37 PM1/21/14
to
On Mon, 20 Jan 2014 19:17:35 +1100, Ben Finney wrote:

> indar kumar <indark...@gmail.com> writes:
>
>> Hint would have been enough but I was strictly discouraged.
>
> You asked for private help, specifically to subvert the rules against
> plagiarism you're subject to.
>
> So no, I don't believe this modification of your request to be sincere.
> You asked for help cheating, and you were refused. Please take a hint,
> and do your assignment under the terms your teacher has set.

That is the harshest, least "good faith" interpretation of the OP's post
I have ever read. It doesn't look to me like that attitude is intended to
be welcoming to students who are trying to walk the narrow tightrope of
being part of a community of programmers who value sharing and
collaboration while avoiding running foul of overly strict academic rules
about so-called plagiarism.



--
Steven

Rustom Mody

unread,
Jan 21, 2014, 10:01:38 PM1/21/14
to
On Wednesday, January 22, 2014 6:21:37 AM UTC+5:30, Steven D'Aprano wrote:
> On Mon, 20 Jan 2014 19:17:35 +1100, Ben Finney wrote:

> > indar kumar writes:
> >> Hint would have been enough but I was strictly discouraged.
> > You asked for private help, specifically to subvert the rules against
> > plagiarism you're subject to.
> > So no, I don't believe this modification of your request to be sincere.
> > You asked for help cheating, and you were refused. Please take a hint,
> > and do your assignment under the terms your teacher has set.

> That is the harshest, least "good faith" interpretation of the OP's post
> I have ever read. It doesn't look to me like that attitude is intended to
> be welcoming to students who are trying to walk the narrow tightrope of
> being part of a community of programmers who value sharing and
> collaboration while avoiding running foul of overly strict academic rules
> about so-called plagiarism.

I was working in a large sw-development company some years ago.
One day unexpectedly I found I could not download any more the FOSS sw
I regularly use. What happened??

Evidently a programmer had copied GPL code off the net, passed it off
as his own, it had gone past the local company'a managers and been
detected by the off-shore client-company. Evidently a dose of GPLd
code is as salutary for the health of commercial sw companies as a
polonium capsule is for humans. Hence the chaos.

So treating Ben's strictures as *purely* academic is at least as harsh
as the strictures themselves

IOW plagiarism is not about some kind of morality but about following
some rules -- which are usually quite arbitrary.

Heck even different free licenses quarrel about what constitutes right
and wrong. And as a consequence of all this, courses and entire
degrees in IP are becoming fashionable

Roy Smith

unread,
Jan 21, 2014, 10:46:52 PM1/21/14
to
In article <c8157920-dca7-4049...@googlegroups.com>,
Rustom Mody <rusto...@gmail.com> wrote:

> I was working in a large sw-development company some years ago.
> One day unexpectedly I found I could not download any more the FOSS sw
> I regularly use. What happened??
>
> Evidently a programmer had copied GPL code off the net, passed it off
> as his own, it had gone past the local company'a managers and been
> detected by the off-shore client-company. Evidently a dose of GPLd
> code is as salutary for the health of commercial sw companies as a
> polonium capsule is for humans.

Absolutely. Most open-source code comes with license restrictions.
"You are free to use this, but if you do, you are obligated to do these
things..." Certainly, GPL comes with obligations. If one of your
employees grabs some GPL stuff off the net and puts it into your
product, you are now obligated to do those things. Those may be
obligations you're not willing to commit to.

indar kumar

unread,
Jan 22, 2014, 3:36:17 AM1/22/14
to
So my question is if I am giving multiple inputs(a new device say for example) in a loop and creating a database(dictionary) for each new devices for example. I want subsequent devices to save their data(values only not keys) to the database of each of the already existing devices. How can I do that? Any hint?I have been stuck here for 3 days.

indar kumar

unread,
Jan 22, 2014, 3:39:48 AM1/22/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Pleae give example also. I will be thankful.

Neil Cerutti

unread,
Jan 22, 2014, 8:34:27 AM1/22/14
to pytho...@python.org
On 2014-01-22, Steven D'Aprano
<steve+comp....@pearwood.info> wrote:
> Do you notice the assumption made? Let me highlight it for you:
>
> THE WORDS OF OTHERS
>
> The hidden assumption here is that *words are property*, that
> they belong to whomever first publishes them. Having now
> written those few words, nobody else is permitted to use those
> same words in the same order without crediting me. Failure to
> credit me is a sin of the highest order, enough to get you
> kicked out of your university, your name blackened. Unless, of
> course, somebody else wrote those words before me, in which
> case *my ignorance* of that earlier usage does not diminish the
> magnitude of my sin. In that regard, plagiarism is rather like
> patent infringement.

>From The Cemetery Gates, The Smiths:

You say, "Ere thrice the sun done salutation to to the dawn,"
and you claim these words as your own. But I've read well and
I've heard them said one hundred times maybe less maybe more.
[...]
You say, "Ere long done do does did;" words which could only be
your own, and then produce a text from whence it was ripped [...]

When grading essays my wife is far more likely to detect the
first case.

> We do not know how strict the OP's college is about so-called
> plagiarism, whether they only intend to come down on outright
> copying of significant bodies of code, or whether they have a
> tendency to go after trivial borrowing of simple idioms or
> minor duplication of insignificant portions of the program. (If
> I walk a linked list using mynode = mynode.next, and you use
> the same variable names, is that an indication of copying?)
> Without knowing what the OP's college considers plagiarism, how
> can judge the OP's reaction to it?

Obvious copying of another person's program, nearly verbatim, is
most likely to be detected. Well, that and submitting one of the
entrapment-purposed answers that are sometimes made availalbe
here and elsewhere.

--
Neil Cerutti

Message has been deleted

indar kumar

unread,
Jan 22, 2014, 11:33:30 AM1/22/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Description of each of the commands:
• config

◦ Parameters: <host_id> <mac addr> <ip addr> <cache timeout>
▪ <cache timeout> is the host's ARP cache timeout, in seconds
◦ Actions:
▪ Update simulator's configuration database.
• If <host_id> already exists, its information should be updated. Otherwise, it should
be added.
▪ Print “<host_id> connected.”
▪ Have the host send a gratuitous ARP request .
• If any other hosts have an outdated entry for the MAC or IP address, they should
update their caches.
• If there are any responses to that request, that means that somebody else has this IP
address. If that is the case, you should print:
Error: <host_id> detected IP address conflict. It will be disconnected.
Then, you should “disconnect” the host from the simulated network, in order to
prevent further problems. You can implement this by removing it from the
configuration database.
◦ Note: any ARP packets generated by the command should be printed in the previously
specified format


Sample Output:

config
Please enter <host_id> <mac addr> <ip addr> <cache timeout>
PC1 01:01:01:01:01:01 192.168.0.1 200
PC1 connected.
ARP request 01:01:01:01:01:01 FF:FF:FF:FF:FF:FF 192.168.0.1 192.168.0.1

indar kumar

unread,
Jan 22, 2014, 11:46:13 AM1/22/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

This is a gratuitous arp request
http://wiki.wireshark.org/Gratuitous_ARP
sent by PC1 is informing other hosts of its MAC and IP addresses.

Any hosts already in existence have their caches updated as needed.

The first config call has no other hosts to update, so all it does is create a dictionary entry with its host id as the key. Its cache table is created as an empty dictionary.

Subsequent config call update all other hosts' cache tables.


Each host has its own ARP cache table.

Rustom Mody

unread,
Jan 22, 2014, 11:48:12 AM1/22/14
to
I suggest that for starters you forget about (real) DBMSes and just use
some lightweight data storage. Some examples of these:
1. json
2. yaml
3. pickle
4. ini file

[I like yaml best but it needs to be installed]

Second I suggest you forget about your assignment/problem, and just
practice getting python data structures -- mainly lists and dicts into
your chosen format.

Third forget about the above and just solve the problem with internal
python data structures.

Then come back here and ask!

indar kumar

unread,
Jan 22, 2014, 11:50:58 AM1/22/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

I need to implement this with simple dictionarie. I know use of dictionaries, lists and tuples. But, I am not able to create a logic in a loop. I mean how the other hosts would get MAC and IP of subsequent hosts in each turn.

indar kumar

unread,
Jan 22, 2014, 11:53:02 AM1/22/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Any link related to such type of problems or logic would be helpful

indar kumar

unread,
Jan 22, 2014, 12:09:07 PM1/22/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Just one hint and I have made the design for whole code. Just stuck at this part

Ned Batchelder

unread,
Jan 22, 2014, 2:19:20 PM1/22/14
to pytho...@python.org
You should collect all your thoughts and write one message, not six in
30 minutes. That's just pestering.

--
Ned Batchelder, http://nedbatchelder.com

Steven D'Aprano

unread,
Jan 22, 2014, 7:01:20 PM1/22/14
to
Short version:

in your dict (database), instead of storing the value alone, store a list
containing each of the values.


Longer version:

Here you have a dict as database:


db = {}

Here you get a key and value, and you add then to the db:

# key is 23, value is "hello"
if 23 in db:
db[23].append("hello")
else:
db[23] = ["hello"]


Later, you can see if the key already exists:

if 23 in db:
print("Key 23 already exists")


Or you can add a second value value to the same key:

if 23 in db:
db[23].append("goodbye")
else:
db[23] = ["goodbye"]


which can be written more succinctly as:


db.setdefault(23, []).append("goodbye")


Now you can check whether the key has been seen once or twice:

if len(db[23]) == 1:
print("key 23 has been seen only once")
else:
print("key 23 has been seen twice or more times")


Does this answer your question?



--
Steven
Message has been deleted

indar kumar

unread,
Jan 23, 2014, 2:46:36 AM1/23/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Thanks for kind help.

I have following nested dictionary

hosts={'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200', {'192.168.0.2': ('02:02:02:02:02:02', 1390461798.531)}], 'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200', {'192.168.0.2': ('02:02:02:02:02:02', 1390461798.531), '192.168.0.1': ('01:01:01:01:01:01', 1390461787.78)}]}


How can I print a particular tuple from this table?


What I am trying to do is
input1=raw_input("Please enter id of host and IP that you want to be resolved")
z=input1.split()
print("PC3 resolved"+' '+z[1]+' to'+hosts[z[0]][3] z[1])

#z[1] is ip entered and [z[0]][3] z[1] is the particular location of value(MAC) associated with IP that I want to print.


But failed to do so. How can I print that. Please guide

indar kumar

unread,
Jan 23, 2014, 2:57:02 AM1/23/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

I just need to print first element of tuple not the whole

Asaf Las

unread,
Jan 23, 2014, 4:46:11 AM1/23/14
to
On Thursday, January 23, 2014 9:57:02 AM UTC+2, indar kumar wrote:
> On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> I just need to print first element of tuple not the whole

in hierarchies do steps level by level, that will make things much easier:

hosts={'PC2':['02:02:02:02:02:02', '192.168.0.2', '200', {'192.168.0.2': ('02:02:02:02:02:02', 1390461798.531)}],
'PC1':['01:01:01:01:01:01', '192.168.0.1', '200', {'192.168.0.2': ('02:02:02:02:02:02', 1390461798.531), '192.168.0.1': ('01:01:01:01:01:01', 1390461787.78)}]}

print(hosts['PC2'])
print(hosts['PC2'][3])
print(hosts['PC2'][3]['192.168.0.2'])
print(hosts['PC2'][3]['192.168.0.2'][1])

indar kumar

unread,
Jan 23, 2014, 5:10:28 AM1/23/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Thank You

I have found this forum very helping...GOD BLESS YOU ALL

indar kumar

unread,
Jan 23, 2014, 4:15:06 PM1/23/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

hosts={'PC2':['02:02:02:02:02:02', '192.168.0.2', '200', {'192.168.0.2': ('02:02:02:02:02:02', 1390461798.531)}],'PC1':['01:01:01:01:01:01', '192.168.0.1', '200', {'192.168.0.2': ('02:02:02:02:02:02', 1390461798.531), '192.168.0.1': ('01:01:01:01:01:01', 1390461787.78)}]}


Hi,
I want to print a value before a particular value inside of a list associated with a key inside main dictionary(hosts) not the one inside nested dictionary.

Forexample,
I want the user to input ip e.g. 192.168.0.2 and then search through dictionary print MAC e.g.02:02:02:02:02:02 that is just before that IP. Note that host id(e.g.PC2) is not known user just inputs IP.

Emile van Sebille

unread,
Jan 23, 2014, 4:28:54 PM1/23/14
to pytho...@python.org
Like this?:

>>> hosts={'PC2':['02:02:02:02:02:02', '192.168.0.2', '200',
... {'192.168.0.2': ('02:02:02:02:02:02', 1390461798.531)}],
... 'PC1':['01:01:01:01:01:01', '192.168.0.1', '200',
... {'192.168.0.2': ('02:02:02:02:02:02', 1390461798.531),
... '192.168.0.1': ('01:01:01:01:01:01', 1390461787.78)}]}
>>>
>>> searchfor = '192.168.0.1'
>>>
>>> print [ ii[0] for ii in hosts.values() if ii[1] == searchfor ]
['01:01:01:01:01:01']


indar kumar

unread,
Jan 23, 2014, 4:34:24 PM1/23/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Just the value e.g.01:01:01:01:01:01 not the list

Emile van Sebille

unread,
Jan 23, 2014, 4:49:30 PM1/23/14
to pytho...@python.org
It may be time for you to work your way through the tutorial.

Emile


indar kumar

unread,
Jan 23, 2014, 4:56:21 PM1/23/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Can I do the following to just get the value as string not the type list?

searchfor = '192.168.0.2'
z=[ii[0] for ii in hosts.values() if ii[1] == searchfor]
>>> str1 = ''.join(z)
>>> str1
Message has been deleted

indar kumar

unread,
Jan 23, 2014, 10:15:51 PM1/23/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Thanks

config_database={'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'], 'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'], 'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200']}

What if I want to search for a particular value inside the lists of all keys except one that user inputs and also want to print that value.

Forexample, user gets prompt to enter following four parameters
prompt1= "Enter <host_id> <ip addr> "

After user has input I have added this information into above dictionary(config_database) but I also need to check if this ip is not already assigned to a PC other than the one which user inputs. So how to search for particular value inside the lists associated with keys other than inside that one which user inputs(because obviously then it would match so just want to skip its own entry) and print that value.




Rustom Mody

unread,
Jan 24, 2014, 12:57:01 AM1/24/14
to
Does this suggest some ideas to you??

>>> config_database={'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200'], 'PC3': ['03:03:03:03:03:03', '192.168.0.3', '200'], 'PC1': ['01:01:01:01:01:01', '192.168.0.1', '200']}

>>> {pc:config_database[pc][1] for pc in config_database.keys()}
{'PC2': '192.168.0.2', 'PC3': '192.168.0.3', 'PC1': '192.168.0.1'}

Or even simpler
>>> {pc:config_database[pc][1] for pc in config_database}
{'PC2': '192.168.0.2', 'PC3': '192.168.0.3', 'PC1': '192.168.0.1'}

indar kumar

unread,
Jan 24, 2014, 2:14:13 AM1/24/14
to
On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
> Hi,
>
>
>
> I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Yes now I want to search for an ip that user has input but skipping the key which user has input. e.g. user entered PC1 and 192.168.0.1. Now I want to scan through config_database to see if this ip is already in it. But PC1 192.168.0.1 is added to config_database before searching so I want to skip PC1 key during searching so that I can see if this Ip is not already associated with any other host.

Steven D'Aprano

unread,
Jan 24, 2014, 3:13:44 AM1/24/14
to
On Thu, 23 Jan 2014 19:15:51 -0800, indar kumar wrote:

> What if I want to search for a particular value inside the lists of all
> keys except one that user inputs and also want to print that value.

Then go right ahead and do so. You are learning Python, so this should be
covered in your course. Did you follow the advice to work through the
Python tutorial?

http://docs.python.org/2/tutorial/
http://docs.python.org/3/tutorial/

depending on whether you are using Python 2 or 3.

This is supposed to be your work, not ours. Start by writing down how you
would solve this problem as a human being:

for each key:
if the key is the one the user inputted, skip this key
otherwise:
get all the lists for this key
for each list:
search for the value


Now change that to Python code. Don't just ask us to solve the problem
for you.


--
Steven
Message has been deleted

Piet van Oostrum

unread,
Jan 24, 2014, 9:13:54 AM1/24/14
to
If you want to extract an element of a list use indexing, like mylist[0].

If you don't know these things or can't find this out yourself, you have a serious lack of knowledge about Python, or maybe about programming, and it is time to learn that first.
--
Piet van Oostrum <pi...@vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]

bob gailer

unread,
Jan 24, 2014, 6:42:58 PM1/24/14
to pytho...@python.org
I had offered to provide some off-line tutoring. My reaction is exactly
what you are saying - he needs to learn the basics. The code he sent me
(after much asking to see some code) was buggy, and a lot of it were the
various suggestions we all made.

I feel for indar. He is in over his head. I recommend we stop trying to
respond to all his requests.
Message has been deleted
0 new messages