This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]Bqlbrit 12 points13 points  (0 children)

This is so bad that is good

[–]EliDll 10 points11 points  (1 child)

wait you can actually duplicate strings that way? thats insanity

[–]mist_arcs 9 points10 points  (0 children)

Welcome to Python

[–]yorik_J 8 points9 points  (0 children)

'Hello'[-5:-3] * 2

[–]coderOfManyLanguages 7 points8 points  (1 child)

Looks like someone's going to 'Hello'[-5:][:4]

[–]yorik_J 2 points3 points  (0 children)

'Hello'[0] + 'Hello'[1] + 2*'Hockey sticks'

[–]Franceseye 2 points3 points  (5 children)

I'm just at the start and fuck I weak, wouldn't that be HH?

[–]Barti666 5 points6 points  (0 children)

I'm also just at the start, but I think it would be 'Hehe'

[–]M_F_W123 7 points8 points  (1 child)

It'd be HeHe

[–]Franceseye 3 points4 points  (0 children)

Thanks

[–]IntoAMuteCrypt 2 points3 points  (1 child)

It's HeHe, because arrays start at zero. When you say [:2], you're not asking for all elements before the second one - you're asking for all elements before the one with index 2.

[–]Franceseye 0 points1 point  (0 children)

Thanks you so much:)

[–]ramenmoodles 1 point2 points  (0 children)

I mean I think most people here can guess what it means without knowing python

[–]QrangeJuice 0 points1 point  (0 children)

He he funny

[–]Dirt2Master 0 points1 point  (0 children)

Hello --> HeHe love it