harru
7 May 2019 10:40
#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.
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
ma0sm
7 May 2019 10:43
#3
I’m not gonna do your homework for you
5 Likes
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
harru
7 May 2019 10:54
#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?
harru
7 May 2019 10:55
#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
Palin > Gillam > Jones > Idle > Cleese
From the purple and pink blur I thought this was going to be something else entirely
1 Like
harru
7 May 2019 11:09
#18
Whats the - 1 all about. Programming languages are obsessed with - 1ing everything
harru
7 May 2019 11:13
#20
Aah I get it now, it’s because it starts at 0. Cool.
1 Like
AQOS
7 May 2019 11:13
#21
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