Python thread (rolling)

This is goong to be a doozy.

I’m learning python. Going to pose occasional problems as I get stuck with it.

I have an exercise where I have to add together the first and last numbers of a list (can be of varying length).

I know I can do it with [-1] to fetch the last element and [0] for the first.

How can I do it though using Len??

I’m trying stuff like

total = list[0] + list[len(list)]

But it doesn’t like it

0 replies

Do Not post pictures of snakes those ones in particular are terrifying.

I tried to learn Python once and gave up pretty quickly after realising it was incredibly boring.

By which I mean: best of luck with your studies!

2 Likes

I’m not gonna do your homework for you

5 Likes

mate

Forget these bloody idiots.

I’ll help you.

What’s Python?

4 Likes

should be

total = list[0] + list[len(list) - 1]

I think

1 Like

nobody expects the span…oh

1 Like

me either

1 Like

grrrr

:open_mouth::open_mouth: eerie

1 Like

WHACHA GONNA DO, HARRU?!

Is that a wrestling thing?

What did they actually do with Jake Roberts snakes? Do you reckon they flew them around America to every venue he was appearing at?

I mean, in a way I literally asked for it.

(I’m not phobic of them or anything but the big squeezy ones freak me out immensely)

1 Like

Palin > Gillam > Jones > Idle > Cleese

From the purple and pink blur I thought this was going to be something else entirely

1 Like

Whats the - 1 all about. Programming languages are obsessed with - 1ing everything

Aah I get it now, it’s because it starts at 0. Cool.

1 Like

Is this the post you were saving to get a potw nomination? Cos I got bad news for ya

One does not simply learn Python. One reads a brief tutorial of Python, learns the phrase “scikit-learn” and then calls oneself a data scientist and asks for a pay rise.

3 Likes

Not good old FORTRAN!

1 Like