[Tutor] exercise problem
Roelof Wobben
rwobben at hotmail.com
Fri Aug 27 18:18:01 CEST 2010
> Date: Fri, 27 Aug 2010 12:00:23 -0400
> From: bgailer at gmail.com
> To: rwobben at hotmail.com
> CC: tutor at python.org
> Subject: Re: [Tutor] exercise problem
>
> I have been reading your posts and responses. I find myself frustrated
> with your lack of understanding of Python fundamentals and the time and
> energy others are putting in that seems to help only a little.
>
> I recommend you take a very basic tutorial, and be sure you understand
> the basic concepts before tackling what seems too hard for you
I follow this basic tutorial : http://openbookproject.net/thinkcs/python/english2e/ch09.html
>
> Also I encourage you to take each error message and look up the topic.
> In this case
>
> getal1 = getal1 + u[teller,0] + v[teller,0]
> TypeError: list indices must be integers, not tuple
>
> What does this error tell you?
That the list index must be a integer.
>
> What is a tuple? What is an integer? Where is there a tuple in this
> expression? What are you trying to do?
What a tuple is i can't tell you. it's in the next chapter.
A integer is a number.
What Im trying to do is that I want all the first numbers of the vectors are added and all the second numbers.
So if I have this vector [1.0] [1,1]
I try to add 1 and 1 and after that I try to add 0 and 1
and put the answer in a new vector.
>
> Look up list indexing and see if you can solve it yourself, then return
> with any questions that arise from this effort.
>
> The more you do for yourself the faster and better you will learn and we
> will be more encouraged to help.
>
> How does this sound to you? Will you give it a try?
Of course I will give it a try.
>
> --
> Bob Gailer
> 919-636-4239
> Chapel Hill NC
>
Roelof
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100827/770b2221/attachment.html>
More information about the Tutor
mailing list