Python thread (rolling)

#1

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.

#2

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
#3

I’m not gonna do your homework for you

5 Likes
#4

I’m not reading the OP

9 Likes
#5

mate

#6

Forget these bloody idiots.

I’ll help you.

What’s Python?

4 Likes
#7

should be

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

I think

1 Like
#8

Feel bad now
Sorry harru good luck x

1 Like
#9

nobody expects the span…oh

1 Like
#10

me either

1 Like
#11

grrrr

#12

:open_mouth::open_mouth: eerie

1 Like
#13

WHACHA GONNA DO, HARRU?!

#14

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?

#15

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
#16

Palin > Gillam > Jones > Idle > Cleese

#17

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

1 Like
#18

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

#19

Dunno why they called it python really. Should of called it adder hahahahaha
Maths and jokes
Maths and jokes

3 Likes
#20

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

1 Like