Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36141

Re: problem with exam task for college

References (1 earlier) <CAPTjJmqGoeb6M3kC8CJ=Vz5c5EKFfJZwfP72j9qKDmoBhOzEtQ@mail.gmail.com> <CAPTjJmo-QEepJVruAZtyy5reoSd-z0kJDbzR3APpzuSKtX2AnQ@mail.gmail.com> <CAN1F8qUueORN3Titi44TxYATyMhqAE6qBUSO1yFE_bceSfoE=w@mail.gmail.com> <mailman.100.1357327851.2939.python-list@python.org> <f5c1a4cb-f96a-4e6d-9f32-511f9bcd04ee@googlegroups.com>
Date 2013-01-05 07:36 +1100
Subject Re: problem with exam task for college
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.102.1357331777.2939.python-list@python.org> (permalink)

Show all headers | View raw


On Sat, Jan 5, 2013 at 7:01 AM,  <jeltedeproft@hotmail.com> wrote:
> woow jeezes, thanks for the amazingly fast and detailed response, you guys are amazing.
>
> thanks again, are you guys getting paid for this or is this voluntarily? either way i really appreciate it

We're all volunteers (and it's now 7:30AM Saturday and I've been up
all night, so this post quite probably doesn't carry the hallmarks of
intelligence). To be more strictly correct, we are members of a
community - people helping people. Far as I know, there's not one
person here who has never asked a question. I tend to join a mailing
list to ask one or more questions, and hang around answering them long
after my personal needs are satisfied, kinda like seeding back a
torrent after you've downloaded it.

We answer questions for a variety of reasons. Partly, because this is
one of the best forms of help that the Python community can offer,
which means that supporting Python in this way strengthens the
language. Partly, because our names are connected to our posts, and we
are seen to be helpful people (and, since the list/newsgroup is
archived on the web, potential employers who search the web for our
names will see us being helpful and knowledgeable). Partly, because
we're repaying the community for the benefits we've gained from it.
Partly, because in answering questions, we ourselves learn. And there
are other reasons too.

> 2) sorry for the dutch names :)

No probs; as was said in several follow-ups, those are well-chosen names.

> b) the problem i originally described in my first post was not resolved, by means of elimination i could conclude that the problem situates itself in this lines :
>
>                 c = list(self.frame.axis)
>                 c[2] -= 0.1
>                 c = tuple(c)
>                 c = self.frame.axis

This code is looking quite messy, here. But the most obvious problem
is that you're setting up 'c' to be the modified axis, and then...
overwriting c with the old axis. Try doing the assignment the other
way in the last line:

self.frame.axis = c

Alternatively, you could do the whole thing more cleanly by unpacking
and then repacking the tuple:

(x, y, z) = self.frame.axis
self.frame.axis = (x, y, z-0.1)

Two lines that do the job of the above four. Note that the parentheses
are optional here; they look nice since axis is holding coordinates,
but Python doesn't care.

Hope that helps!

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

problem with exam task for college jeltedeproft@hotmail.com - 2013-01-04 10:23 -0800
  Re: problem with exam task for college Chris Angelico <rosuav@gmail.com> - 2013-01-05 05:59 +1100
  Re: problem with exam task for college Chris Angelico <rosuav@gmail.com> - 2013-01-05 06:00 +1100
  Re: problem with exam task for college MRAB <python@mrabarnett.plus.com> - 2013-01-04 19:17 +0000
  Re: problem with exam task for college Joshua Landau <joshua.landau.ws@gmail.com> - 2013-01-04 19:18 +0000
  Re: problem with exam task for college Chris Angelico <rosuav@gmail.com> - 2013-01-05 06:30 +1100
    Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-04 12:01 -0800
      Re: problem with exam task for college Chris Angelico <rosuav@gmail.com> - 2013-01-05 07:36 +1100
      Re: problem with exam task for college Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-05 16:09 -0500
    Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-04 12:01 -0800
  Re: problem with exam task for college Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-04 17:11 -0500
  Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-05 04:24 -0800
    Re: problem with exam task for college Chris Angelico <rosuav@gmail.com> - 2013-01-05 23:39 +1100
  Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-05 05:14 -0800
    Re: problem with exam task for college Chris Angelico <rosuav@gmail.com> - 2013-01-06 00:32 +1100
  Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-07 08:22 -0800
    Re: problem with exam task for college Vincent Vande Vyvre <vincent.vandevyvre@swing.be> - 2013-01-07 18:40 +0100
    Re: problem with exam task for college Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-07 15:36 -0500
  Re: problem with exam task for college jeltedeproft_8@hotmail.com - 2013-01-13 04:29 -0800
  Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-13 04:48 -0800
  Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-13 05:57 -0800
    Re: problem with exam task for college Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-01-13 17:28 +0000
  Re: problem with exam task for college stefaang@gmail.com - 2013-01-14 04:57 -0800
  Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-14 08:01 -0800
    Re: problem with exam task for college Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-14 13:54 -0500

csiph-web