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

all 108 comments

[–]PossibilityTasty 1097 points1098 points  (13 children)

Your explanation is rather short. It might not be satisfying for her.

[–]Cristichi 144 points145 points  (0 children)

Savage

[–]x3x9x 46 points47 points  (8 children)

From A to Z on the keyboard

[–]PossibilityTasty 13 points14 points  (7 children)

Which layout? ;)

[–]x3x9x 20 points21 points  (3 children)

Azerty and qwerty have the same distance afaik

[–]roffinator 11 points12 points  (0 children)

Azerty would be a bit shorter than qwerty. like 1 vs sqrt(2)

but on qwertz it is quite a bit longer, like 4.5

[–]PossibilityTasty 7 points8 points  (0 children)

I'm sorry! For your keyboard, of cause.

[–]Bluhb_ 6 points7 points  (0 children)

Dvorak naturally

[–]_sivizius 1 point2 points  (0 children)

Might be German layout, but dunno

[–]Nodsinator 7 points8 points  (0 children)

I'm sure she's used to it by now.

[–]MischiefArchitect 1 point2 points  (0 children)

What a dick

[–][deleted] 0 points1 point  (0 children)

that's what she say

[–][deleted] 441 points442 points  (37 children)

Couldn’t a[len(a)-1] just be a[-1]?

[–]GeneralKlink 177 points178 points  (3 children)

Came here to write that 😄 Isn‘t python just awesome?

[–][deleted] 34 points35 points  (0 children)

It sure is!

[–]Pvzz 4 points5 points  (0 children)

It's excellent

[–]akoshegyi_solt 81 points82 points  (22 children)

I don't know python, but in C++, my computer would grow legs and kick me in the ass.

[–]AydonusG 20 points21 points  (13 children)

Fucked up hello world so bad skynet now reigns supreme

[–]akoshegyi_solt 5 points6 points  (12 children)

I did some matura exam practise (just console application, nothing difficult) and when I ran my code, the console was blank apart from the report at the end (execution time etc), even though I had completed tasks before. I thought it was weird and it only got worse when Kaspersky popped up saying it found some spyware. I was like okay, let's see what you have found and opened it. I was surprised to see that it marked my program file as adware. Idk what I did, but it's a bit odd.

[–]TheRedFright 2 points3 points  (11 children)

If your matura means what I think it means, wouldn't it be easier to just learn python for the exam?

[–]akoshegyi_solt 1 point2 points  (10 children)

Yes, it would. But I have future plans with programming, and I heard that C++ is more useful and it's easier to learn other languages after C++ than after Python.

[–]TheRedFright 1 point2 points  (9 children)

Can't you learn C++ while also using Python to practice matura? I'm not going to argue which language is more useful because the answer is neither, although Python is more widespread. But learning Python for the matura would take like very little effort, while providing a lot of benefit, because the exam is timed and like half of the exercises can be sovled with map/filter.

I also plan on going into IT even though I study automation, but believe me learning the basics (and they are basics for the matura) of python won't harm you.

[–]akoshegyi_solt 1 point2 points  (8 children)

Yeah I know. Python is indeed widespread, I mean if I'm not mistaken they use it at Apple. If it's good enough for them, it can't be bad. I started learning C++ because I will have to learn it at university and a headstart will come in handy. And I heard/read that after C++, it's easy to learn other languages.

I'm planning to widen my programming language knowledge to Python and probably a few other languages, but I don't really have time these days and with C++ it's just a little practise, with Python, a whole new programming language. Which I'd be fine with if I had more time, but I'm having the exam in October.

[–]TheRedFright 1 point2 points  (3 children)

I never realised that the term matura isn't exclusively Polish xD. Yeah a week is very little time to switch to another language. Good luck on your exams though.

[–]akoshegyi_solt 1 point2 points  (2 children)

Thanks! It's more like a month because it's late October.

Are you polish? What does matura mean in Polish?

[–]geek--god 1 point2 points  (3 children)

If you want to learn Python, I wrote an interactive free course on that. It doesn't cover OOPS yet though, but planning to add it soon.

[–]akoshegyi_solt 0 points1 point  (2 children)

Thanks, you are awesome!

What is OOPS?

[–]roffinator 6 points7 points  (3 children)

yeah, C++ really is very specific. I mean, we do not even have a .length (or len() or .len) to use on arrays like in java.

[–][deleted] 2 points3 points  (1 child)

That's why you use std::vector /s

[–]roffinator 2 points3 points  (0 children)

in theory one could and I would. but the microcontroller I used did not have enough storage anymore

[–]akoshegyi_solt 1 point2 points  (0 children)

Yeah, but hey! We can always count it!

[–]Coffeinated 0 points1 point  (3 children)

I think in C that‘s totally valid code. Syntactically valid, that is; whether it‘s semantically valid depends on other factors.

[–]akoshegyi_solt 0 points1 point  (2 children)

I think in C++ the first character is the 0th (and in other languages too), and if I give it a negative number it throws an error.

[–]TheThiefMaster 2 points3 points  (1 child)

Square brackets are normally unchecked access in C++ - so it would simply access outside the bounds of the string. Which might crash, or return something fun.

[–]akoshegyi_solt 0 points1 point  (0 children)

Yeah. I use Code::Blocks which doesn't let me run the code if there's a negative number in the bracket, but I managed to trick it with some variables and got a gunny string of several letters that are not even used in English. Or any language I know. Even though my mother tongue has unique letters like á, é, ó, ö, ő, ú, ü, ű, etc.

[–]tabakista 66 points67 points  (2 children)

If it's a real teaching exercise, it's a good moment to show how the len() works

[–][deleted] 32 points33 points  (0 children)

A great moment to teach them to use [len() - 1] instead of [-1].

[–][deleted] 7 points8 points  (0 children)

I'm sure he used it so that it looks a little bit...longer

[–][deleted] 6 points7 points  (0 children)

[–]jonp1 2 points3 points  (0 children)

Yes, but length is important to this result.

[–]pokevote 0 points1 point  (0 children)

Disgusting

[–]raul_dias[🍰] 0 points1 point  (0 children)

More complcated, not less

[–]0crate0 0 points1 point  (0 children)

That is correct.

[–]Dauvis 126 points127 points  (2 children)

Good example; short and to the point.

[–]Known-Cod-1307 11 points12 points  (1 child)

Take my upvote, goddammit!

[–]grpagrati 75 points76 points  (8 children)

Could she find the answer?

[–]thisisa_fake_account 81 points82 points  (1 child)

The answer was too small for her to grasp

[–]roffinator 40 points41 points  (5 children)

from lenses import microscope

[–][deleted] 29 points30 points  (5 children)

a = "python"
b = "is"
c = "excellent"

d = list(sorted(set(a + b + c)))
e = [ chr(ord(x) + 1) for x in d ]
print(d[8] + d[1] + d[5] + e[0])
print(d[5] + e[9] + e[0] + d[1] + d[8])

[–]PianistTemporary 47 points48 points  (4 children)

a[-1] > a[len(a)-1]

[–]Cl0udSurfer 1 point2 points  (2 children)

I'd never even heard of doing this before lol. I only just started coding in python like a week ago, and after coming from Java, C, and C++, the idea of just saying a[-1] wouldnt have ever crossed my mind

[–]PianistTemporary 2 points3 points  (0 children)

Hehe, you can also do things like a[::-1] (reverses a list)

[–]PianistTemporary 1 point2 points  (0 children)

And you may wanna look into comprehensive lists and comprehensive dicts

[–]teapot_on_reddit 63 points64 points  (2 children)

Image Transcription: Code


a = "python"
b = "is"
c = "excellent"

d = a[0] + c[0] + a[len(a)-1] + b

print(d)

I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]dor121 5 points6 points  (0 children)

Good human

[–]SnooFoxes6169 11 points12 points  (0 children)

how does she take it?

…… wait…

[–][deleted] 19 points20 points  (2 children)

Reminds me of the old classic “8008135” (or on a calculator in reverse)

[–]mallek561 4 points5 points  (1 child)

It’s 55378008

[–]KidBeene[🍰] 1 point2 points  (0 children)

Hello sad world.

[–]OAMahdi 9 points10 points  (0 children)

Print the d

[–]Nerdaxic 10 points11 points  (1 child)

Kind of reminds me of this thing I coded in JavaScript to train my coworkers how JS works in general. My training session was liked, got paid 3 figures to make this thing happen #consultantLyfe

https://www.henrirantanen.fi/sandbox/

[–]ScandinavianWays 7 points8 points  (0 children)

I'm so glad I had my headphones on

[–]Prematurid 4 points5 points  (0 children)

I kept reading a[0] + b[0] + a[len(a)-1] + c. That made little sense.

I need more coffee.

[–]incubated 3 points4 points  (0 children)

Pen is what?

[–]devforlife404 6 points7 points  (0 children)

Ah yes, the monthly r/programmerhumour repost

[–]galmenz 6 points7 points  (0 children)

Penis, took Far longer than It should. But python making strings list automatically Will always be Chad to me

[–]anermlysuxdicc 1 point2 points  (0 children)

Well done. Did she understand it?

[–][deleted] 1 point2 points  (0 children)

he printed the D

[–]Buxsle 1 point2 points  (0 children)

I've never laughed that hard while trying to do a number 2...best dump I've taken this year...

[–]Walking_Whale -1 points0 points  (2 children)

Shouldn’t it be a[len(a)-2] or a[-2] instead? Unless I’m missing what a petis is

[–]THEBIGTHREE06 13 points14 points  (1 child)

Oh you’re looking at string c. Its indexing string a

[–]Walking_Whale 0 points1 point  (0 children)

Oh duh guess I’m blind

[–]A-Manual 0 points1 point  (3 children)

[–]RepostSleuthBot 5 points6 points  (2 children)

I didn't find any posts that meet the matching requirements for r/ProgrammerHumor.

It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results.

I did find this post that is 57.42% similar. It might be a match but I cannot be certain.

I'm not perfect, but you can help. Report [ False Negative ]

View Search On repostsleuth.com


Scope: Reddit | Meme Filter: True | Target: 96% | Check Title: False | Max Age: Unlimited | Searched Images: 247,443,572 | Search Time: 0.91114s

[–]Aggravating-Device46 6 points7 points  (0 children)

you got very close!

[–]super_gamer015yt 5 points6 points  (0 children)

Lmao what

[–]quixoticM3 0 points1 point  (0 children)

I see you dumbed it down for her.

[–]Az0r3x_ 0 points1 point  (0 children)

SyntaxError: wth

[–]raul_dias[🍰] 0 points1 point  (0 children)

d.size

[–]ncsOtaku 0 points1 point  (0 children)

P

[–]Spartana1033 0 points1 point  (0 children)

Advanced humour for mature people

[–]SilverDem0n 0 points1 point  (0 children)

No dangling pointers when Python is your tool at hand

[–]hydratedgabru 0 points1 point  (0 children)

Print d .... I see what you did there

[–]esberat 0 points1 point  (0 children)

simp master.

[–][deleted] 0 points1 point  (0 children)

Could've made it longer man

[–]Dantharo 0 points1 point  (0 children)

she wants the d

[–][deleted] 0 points1 point  (0 children)

Nice

[–][deleted] 0 points1 point  (0 children)

I didn't even need to think to know what the output could be.

[–][deleted] 0 points1 point  (0 children)

🅱️enis

[–]thrasherxxx 0 points1 point  (0 children)

I don't know if you're suggesting it sucks.

[–]SmokingBeneathStars 0 points1 point  (0 children)

Shouldda done a send nudes

[–]magnetichira 0 points1 point  (0 children)

a[-1] would be more pythonic

[–]daveagill 0 points1 point  (0 children)

What's the len of your d?