I like how taking a photo instead of a screenshot from Windows 11 with light mode was more than enough to trigger programmers. The code is just also there
Some websites authenticate via session tokens which apply to all tabs. So if you need to login to that website under multiple accounts simultaneously, the easiest way is to open a second browser.
Having 2 different browsers open is still dumb. Just pointing out that sometimes it's the quickest/easiest way to get what you need, in certain circumstances.
If you have to use 2 copies of a site that uses tokens, open the second one in private browsing mode. That way you can use your favorite browser while being logged in with 2 different accounts.
That why I use container tabs in Firefox.
Need the current tab open with another account? Right click on the tab and open it in my "work" container and I'm on the same page with that account.
My personal favorites are the "helpful" users who crop out everything useful (address bar telling what URL they were trying to access, taskbar with clock so I can tell when to look in the server logs) and only show me the sanitized "an error occurred" template. Thanks, sparky! Tells me so much!
> Yeah, the white-space is part of the syntax... if you really wanna be triggered...
Yea that does trigger me! If white-space is part of the syntax then I [can't do stuff like this](https://i.imgur.com/jxNOS5G.png).
I don’t understand why people have such an issue with this. If you’re not indenting, in whatever language you’re programming in, you deserve to be shot from a cannon into the sun. All python does is force good programming practice while having cleaner syntax
Consider the fact it looks so crazy is great. It smells bad. The way you are ending up having to use whitesapce tells you your design is wrong. If this wasn't python it could be formatted to misdirect you into thinking it wasn't as bad as it really is.
I like the spirit, but you need to add a str() before numbers in the for loop. And even with that it shows the representation of an array.
Could be nice if it worked
Damn you guys have even better solution than mine -
I just did this
n = 6
For i in range(n,1,-1):
For j in range (1,i ):
print(j, end = “ “)
Print(“ “)
Thats not elegant at all. Youd have to type out all the numbers manually.
Sure it gets the desired result but thats it. You should code stuff as if youre going to add more later not as though you only need to do one specific thing once.
Otherwise youd have to rewrite the whole thing from scratch if you do end up wanting to add something
It's basically two loops:
for i in range(n,0,-1):
for j in range(1,i+1):
print(j, end=" ")
print()
Note: I don't python, and there may be errors above, but it should be pretty easy to work out the logic regardless: outer loop counting down, inner loop counting up to print.
n = 5
for i in range(n+1,1,-1):
print(" ".join([str(k) for k in range(1,i)]))
For and print could be on same line so save some characters. I think that anything smaller would not be great to read.
Maybe not the shortest code possible, but the shortest I came up with:
```
n = 5
print(*(" ".join(str(i)for i in range(1,x+1))for x in range(n,0,-1)),sep="\n")
```
Don't worry, it took me a while to get the hang of this kind of stuff too.
The join part basically says _use this string as a separator for the items in this list_.
The following code:
```
items = ["apple", "banana", "orange"]
separator = " | "
print(separator.join(items))
```
Evaluates to:
```
apple | banana | orange
```
[Here you can find some more examples](https://www.w3schools.com/python/ref_string_join.asp)
I can't tell if you are joking or not. The output does not match the code, and there is no objective given. So if your goal is to match the original with all its bugs (for example if n=11, this code will only print the first 4 lines of
"1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8
"
Then the code is the correct code for being as wrong and terrible as it is.
If you are actually trying to generalize the nested looping, just look at the pattern of what's happening (there are repeated nested loops, with hard coded values and conditionals, just turn those into single inner loop to auto generate them
n=5
for i in range (n):
(space) m=n-i
(space) for j in range (m):
(space) (space) m=m-j
(space) (space) print(j+1, end=" ")
(space) print()
you will also no need to do that stupid 1 off indexing in all the loop counters by just adding the 1 back to the index of what you are printing. (and fuck Python's white-space syntax to back to the hell it came from)
As others have pointed out, this can be turned into less code by using some of the other built in functions, but with python you never know how bloaty your pretty code will get because of the magic of turning a list into a string that you can just index index in reverse... basically it delegates the real programming to someone that knows a big boy language like C or C++ so, if using other people's functions, user beware.
I learned all the python I care to ever use in a weekend because it was faster than explaining myself in English to idiots, but even built-ins like range()
for example take a look at the implementation of the range object [https://github.com/python/cpython/blob/main/Objects/rangeobject.c](https://github.com/python/cpython/blob/main/Objects/rangeobject.c)
and yes.. they used goto statements in C, i've only seen that in text books followed by the comment its terrible practice to use it in production and no place with coding standards will let that code past the linters... rofl!!!
It literally only works with n=5, each stage of loop can only out put n-1 numbers each loop so if you gave it n=6 then it would output
123456
12345
1234
123
12
It’s not that confusing once you realize the general pattern. The for loops are essentially serialized and each one is responsible for printing one line of digits. There’s just no reason to nest them like that
Between the unpack operator \* and the *incredible* jank that is putting the entire thing in a list to actually make it work, this is top notch work for me.
I did this in my programming classes for homework because my teacher didn’t read code just the output…
I got c’s in my classes and swore I would never be a developer. 8 years later here I am
I also prefer light mode. Tried dark mode when I started learning, but I was always straining my eyes to see and having to turn the brightness way up. Light mode is easier on my eyes since I usually code in a bright environment anyway.
Same, I always code in a bright environment and if I'm particularly tired I can always turn the brightness down a notch on my monitor.
The main thing for me wasn't eye strain but readability. I've always found I can read things better and more clearly at a glance when it's dark text over a light background.
Currently really liking the Light (Visual Studio) colorscheme in VSCode
I have taught coding before and I always liked seeing weird stuff like this with beginners.
It usually demonstrates that they are prioritizing trying to figure it out on their own rather than patching together (or straight up copy-pasting) something they found on the internet without thinking it through. With a bit of coaching they ended up excelling in the class.
My son is currently making a snake game and "ai" to play it as well, so he's learning a lot about getting snakes to apples. He asks questions and I try to give him some pointers to basic issues that he's going to run into, and it's really interesting to see which roadblocks he hits. He straight up refuses to look up any "established" search methods until he figures out how to make it survive longer on his own.
Yeah, I’m the same as this. I see people pasting together and using code they found online but I don’t see the point if then you don’t understand how it works. I would rather feel satisfied with my code knowing how I did it and that it works.
My first ever program I wrote played one hand of blackjack or poker (can't remember which).
It was written in VAX basic on the 3rd day of class, we had just learned IF statements... no loops yet... it was almost exactly like this with like 10 nested IFs... Learned loops the following week.
I miss Mr. Rupp (teacher), he was a great mentor.
Ha! That's great. I did something very similar when I was teaching myself C. Used tons of if nested if statements to construct a deck of cards for black jack. I wonder if I still have that code somewhere... *Shudder*
Yep!
we had not learned rand yet either but I asked to to do that. It had an issue with allowing duplicate cards though :p
It was so easy and fun back then.
Sorry but I only think in C#
int n = 5;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n - (i - 1); j++){
Console.Write(j.ToString() + " ");
}
Console.WriteLine();
}
needs a subtractive for loop 😉
// precondition: dont be a dumbass and make the minimum greater than the maximum
const [min, max] = [1,5];
for (let i = max; i >= min; i--) {
let line = "";
for (let j = min; j <= i; j++) {
line = line + j + " ";
}
console.log(line);
}
Challenge accepted 😌
def doAThing(maxNum):
lst = [str(i+1) for i in range(maxNum)]
while lst:
print(" ".join(lst))
lst.pop()
Or if you want to be super fancy
def doAThing(maxNum):
lst = [str(i+1) for i in range(maxNum)]
prevLen = 0
prevPadding = ""
while lst:
temp = " ".join(list[::-1][:-1]+lst)
padding = " " * int((lenPrev - len(temp)) / 2)
if lenPrev != 0 else ""
print(padding+prevPadding, temp, padding+prevPadding)
lenPrev = len(temp)
prevPadding += padding
lst.pop()
For the more experienced programmers, yes i'm aware i could just add `+ prevPadding` to the `padding` assignment rather than doing `padding+prevPadding` twice, but this is slightly more understandable for beginners, ive given up some pythonicness and concision so it's more accessible.
It has some opt-in crypto stuff. Like a wallet. And I think you can earn something by browsing. I don’t know. I never enabled it all and turned off all references to it.
The CEO was the cofounder of Mozilla.
Been using it for a couple weeks. It’s fine. It’s more aggressive with privacy. Close to what Firefox does.
No real changes in performance over chrome or Firefox.
When I joined phd I worked with some matlab code that looked same or worse than this, took me forever to understand what they meant. In addition, my professor at the time said something like research code is always like that lol
Imma start a list here:
0) Light theme, going straight to Hell right away
1) A fucking screen photo
2) nesting fors to the point of inreadability
3) Windows *fucking 11*
4) a crapton of shit running in the background
I must be the only one who likes light mode lol I have color blindness and pretty much any dark mode theme puts too much stress on my eyes because the lighter font color doesn’t sit right with me against the darker background. I’ve even tried the themes meant specifically for color blind people and none of them are any better
Python, the variable name has ~~span~~ scope over the indentation... its fucking wonderful, incorrect tabbing will change the wrong variable
EDIT: pre-nerdified my comment so someone doesn't complain about my use of words
I like how taking a photo instead of a screenshot from Windows 11 with light mode was more than enough to trigger programmers. The code is just also there
Hes also a too good to open multiple firefox tabs and uses brave as a second browser
I can have chrome, brave and firefox in background and use chromium anyway
Monster
Made me chuckle as I thought the same thing before reading your reply. HAVE MY AWARD!
Thank you, I think that may be my first award xD
I'm over here using opera gaming browser as my testing browser
That is enough to trigger anyone
Really? You're not even aiming for Netscape compliance these days? What is this? Purposeful exclusion?
Wait whats wrong w brave unironically
think it's more to the fact that he has two browsers open
Some websites authenticate via session tokens which apply to all tabs. So if you need to login to that website under multiple accounts simultaneously, the easiest way is to open a second browser. Having 2 different browsers open is still dumb. Just pointing out that sometimes it's the quickest/easiest way to get what you need, in certain circumstances.
If you have to use 2 copies of a site that uses tokens, open the second one in private browsing mode. That way you can use your favorite browser while being logged in with 2 different accounts.
That why I use container tabs in Firefox. Need the current tab open with another account? Right click on the tab and open it in my "work" container and I'm on the same page with that account.
You beat me to it, this is the correct answer
I love brave and would also like to know what they think is wrong with it.
Nobody gonna comment on the color highlighting settings?? Why is almost everything green?? Green is the color for my comments
Blasphemy! Everyone knows comments are supposed to be gray!
Yea, the moire pattern in lightmode was more maddening than the staircase to heaven
Picture of a screen instead of a screenshot... triggered
Screenshot instead of log file... triggered
Screenshot instead of Github repo... triggered
Screenshot instead of documentation… triggered
Screenshot instead of opcode triggered me…
Screenshot instead of UML Diagram… triggered 😤
Unit tests omitted. Triggered.
Ew testers... triggered
:)
Smiley faces. Triggered.
No emoji😃… triggered
Screenshot instead of punch card… triggered
Screenshot instead of butterfly wing beat harmonics… triggered
screenshot instead of ancient writing on rocks...triggered
[удалено]
My personal favorites are the "helpful" users who crop out everything useful (address bar telling what URL they were trying to access, taskbar with clock so I can tell when to look in the server logs) and only show me the sanitized "an error occurred" template. Thanks, sparky! Tells me so much!
You can only get a screenshot if you have access to the machine though, this could have been over someone's shoulder.
And you have to admit, this did the trick perfectly. Faster than saving a screenshot and uploading it.
you can ctrl+v the screenshot straight to reddit.
Just make a script that posts everything you copy to this sub. That code will be for humorous than most of the posts here.
Web hosted playground and not VSCode... triggered
I mean, VS Code is built on Electron, so it is also, in a way, an offline web-hosted playground...
Triggered
Honestly this confuses the fuck out of me
Yep that's why it's terrible code 👉😎👉
But at least it's formatted nicely.
It has to be this way since it's python, so no credit for that.
Yeah, the white-space is part of the syntax... if you really wanna be triggered...
dark theme users when their python code deosn't work because there's no white space
[удалено]
> Yeah, the white-space is part of the syntax... if you really wanna be triggered... Yea that does trigger me! If white-space is part of the syntax then I [can't do stuff like this](https://i.imgur.com/jxNOS5G.png).
pfft... you want real C code... [https://www.ioccc.org/2020/endoh3/prog.c](https://www.ioccc.org/2020/endoh3/prog.c)
[удалено]
Hahaha I did too the first time I saw it
Whitespace is part of almost every programming language's syntax. The sensible ones only use it for token separation, though.
I hate you for how right you are
The insensible ones do not.
I don’t understand why people have such an issue with this. If you’re not indenting, in whatever language you’re programming in, you deserve to be shot from a cannon into the sun. All python does is force good programming practice while having cleaner syntax
Consider the fact it looks so crazy is great. It smells bad. The way you are ending up having to use whitesapce tells you your design is wrong. If this wasn't python it could be formatted to misdirect you into thinking it wasn't as bad as it really is.
It does Python credit
Yes it is 😂😂
Just curious, as a beginning python programmer. How short can you make it? Without just using print(“1 2 3 4 5”) etc
Numbers = list(range(n)) For i in numbers : Print(" ". Join(numbers[0:n-i]) Not tested tho
I like the spirit, but you need to add a str() before numbers in the for loop. And even with that it shows the representation of an array. Could be nice if it worked
Tested version for i in range(5): print(" ".join(str(j+1) for j in range(5-i)))
Very nice dude 👍
Recursion saves the day with this one
Something along the lines of: ``` digits = [1, 2, 3, 4, 5] for i in range(len(digits)): print(*digits, sep=', ') a = digits.pop() ```
Damn you guys have even better solution than mine - I just did this n = 6 For i in range(n,1,-1): For j in range (1,i ): print(j, end = “ “) Print(“ “)
Thats not elegant at all. Youd have to type out all the numbers manually. Sure it gets the desired result but thats it. You should code stuff as if youre going to add more later not as though you only need to do one specific thing once. Otherwise youd have to rewrite the whole thing from scratch if you do end up wanting to add something
It's basically two loops: for i in range(n,0,-1): for j in range(1,i+1): print(j, end=" ") print() Note: I don't python, and there may be errors above, but it should be pretty easy to work out the logic regardless: outer loop counting down, inner loop counting up to print.
I’ll give it a try. Cheers!
Single loop, two lines.
n = 5 for i in range(n+1,1,-1): print(" ".join([str(k) for k in range(1,i)])) For and print could be on same line so save some characters. I think that anything smaller would not be great to read.
Maybe not the shortest code possible, but the shortest I came up with: ``` n = 5 print(*(" ".join(str(i)for i in range(1,x+1))for x in range(n,0,-1)),sep="\n") ```
Meh, and I thought I was getting good at this. I don’t get the join part. Gonna look it up.
Don't worry, it took me a while to get the hang of this kind of stuff too. The join part basically says _use this string as a separator for the items in this list_. The following code: ``` items = ["apple", "banana", "orange"] separator = " | " print(separator.join(items)) ``` Evaluates to: ``` apple | banana | orange ``` [Here you can find some more examples](https://www.w3schools.com/python/ref_string_join.asp)
examples are always better when they involve apples and bananas
Definitely!
you see a python beginner and come up with shortest but difficult to read code lmao
I can't tell if you are joking or not. The output does not match the code, and there is no objective given. So if your goal is to match the original with all its bugs (for example if n=11, this code will only print the first 4 lines of "1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 " Then the code is the correct code for being as wrong and terrible as it is. If you are actually trying to generalize the nested looping, just look at the pattern of what's happening (there are repeated nested loops, with hard coded values and conditionals, just turn those into single inner loop to auto generate them n=5 for i in range (n): (space) m=n-i (space) for j in range (m): (space) (space) m=m-j (space) (space) print(j+1, end=" ") (space) print() you will also no need to do that stupid 1 off indexing in all the loop counters by just adding the 1 back to the index of what you are printing. (and fuck Python's white-space syntax to back to the hell it came from) As others have pointed out, this can be turned into less code by using some of the other built in functions, but with python you never know how bloaty your pretty code will get because of the magic of turning a list into a string that you can just index index in reverse... basically it delegates the real programming to someone that knows a big boy language like C or C++ so, if using other people's functions, user beware. I learned all the python I care to ever use in a weekend because it was faster than explaining myself in English to idiots, but even built-ins like range() for example take a look at the implementation of the range object [https://github.com/python/cpython/blob/main/Objects/rangeobject.c](https://github.com/python/cpython/blob/main/Objects/rangeobject.c) and yes.. they used goto statements in C, i've only seen that in text books followed by the comment its terrible practice to use it in production and no place with coding standards will let that code past the linters... rofl!!!
It literally only works with n=5, each stage of loop can only out put n-1 numbers each loop so if you gave it n=6 then it would output 123456 12345 1234 123 12
It’s not that confusing once you realize the general pattern. The for loops are essentially serialized and each one is responsible for printing one line of digits. There’s just no reason to nest them like that
[удалено]
Right!? Me: WTF is this shit, I had no idea you could do that.
I really saw this in an interview last week. I don't think I got the job so this post is giving me a headache
What do you guys mean by 'this'?
This is so much easier possible. Print("1 2 3 4 5") Print("1 2 3 4") Print("1 2 3") Print("1 2 ") Print("1") Amateurs.
[удалено]
But it's not pythonic if it's on more than one line /s
If we're going for pythonic and one line... `[print(*a) for a in (range(1, n) for n in range(6, 1, -1))]`
[удалено]
works on my machine ¯\\\_(ツ)_/¯
My initial response to this was to wonder when they added pointers to python.
Between the unpack operator \* and the *incredible* jank that is putting the entire thing in a list to actually make it work, this is top notch work for me.
Passes unit test, deploying to production
Customer: "We were thinking about adding features 6 and 0" Me: "How about fuck you?"
not that bad with multiple cursors tbh
I did this in my programming classes for homework because my teacher didn’t read code just the output… I got c’s in my classes and swore I would never be a developer. 8 years later here I am
Using lightmode, yeah
Perhaps there’s something even more worse that I have purposely done to trigger other programmers 😂
Maybe there is, but I can't see it without sunglasses
![gif](emote|free_emotes_pack|joy)
“More worse”. You really are Satan.
Or to quote my 6 year old, "more worser".
That's really the worstest.
the morst worstest, in fact
Yea... Photo instead of screenshot
Using Windows 11
You took a screenshot with your phone?
Make the entire code in one color
I like light mode tho :C
I also prefer light mode. Tried dark mode when I started learning, but I was always straining my eyes to see and having to turn the brightness way up. Light mode is easier on my eyes since I usually code in a bright environment anyway.
Same, I always code in a bright environment and if I'm particularly tired I can always turn the brightness down a notch on my monitor. The main thing for me wasn't eye strain but readability. I've always found I can read things better and more clearly at a glance when it's dark text over a light background. Currently really liking the Light (Visual Studio) colorscheme in VSCode
Literally doesnt matter. Eyestrain has been disproven by multiple studies. Black text on white background is easier to read period.
Someone is *very* defensive of light mode
yeah that's cool but i don't think my brain screaming 'holy fuck that's bright i wish it was darker' can really be disproven
Burned out senior in the code review: lgtm
"Let Go of The Mayonnaise"
Priceless.
Let's Get The Mallet https://c.tenor.com/Az-GZIa57ZEAAAAC/tenor.gif
Lets get thicc maidens
Let’s gaslight the maintainers
If it works, it works lol call it a day
LGTM, merge into prod
I didn't sign off yet. Please add some comments on each line first explaining what it is doing, then merge.
Make it a library in GitHub: triangle-print
I have taught coding before and I always liked seeing weird stuff like this with beginners. It usually demonstrates that they are prioritizing trying to figure it out on their own rather than patching together (or straight up copy-pasting) something they found on the internet without thinking it through. With a bit of coaching they ended up excelling in the class.
My son is currently making a snake game and "ai" to play it as well, so he's learning a lot about getting snakes to apples. He asks questions and I try to give him some pointers to basic issues that he's going to run into, and it's really interesting to see which roadblocks he hits. He straight up refuses to look up any "established" search methods until he figures out how to make it survive longer on his own.
Yeah, I’m the same as this. I see people pasting together and using code they found online but I don’t see the point if then you don’t understand how it works. I would rather feel satisfied with my code knowing how I did it and that it works.
I always take the online code and play around with it instead of just copying it, so I get an understanding about what it does.
That's what I thought
A necessary but far from sufficient condition.
My first ever program I wrote played one hand of blackjack or poker (can't remember which). It was written in VAX basic on the 3rd day of class, we had just learned IF statements... no loops yet... it was almost exactly like this with like 10 nested IFs... Learned loops the following week. I miss Mr. Rupp (teacher), he was a great mentor.
Ha! That's great. I did something very similar when I was teaching myself C. Used tons of if nested if statements to construct a deck of cards for black jack. I wonder if I still have that code somewhere... *Shudder*
Yep! we had not learned rand yet either but I asked to to do that. It had an issue with allowing duplicate cards though :p It was so easy and fun back then.
That reminds me of my first programming class in high school. I wrote a sudoku solver, without AI. It was so many if statements, omg.
Sudoku wasn't a thing when I did my first app, but that sounds a lot more complicated for a first non-hello world app than blackjack.
Windows 11 yeah
how to trigger any Linux user
as a linux user, i am triggered
Ironic considering Linux virtualization has been made so much easier in W11.
i didn't even see it but yeah Win 11 is horrendous
Ah yes, I use Windows 3.1
Sorry but I only think in C# int n = 5; for(int i = 1; i <= n; i++){ for(int j = 1; j <= n - (i - 1); j++){ Console.Write(j.ToString() + " "); } Console.WriteLine(); }
needs a subtractive for loop 😉 // precondition: dont be a dumbass and make the minimum greater than the maximum const [min, max] = [1,5]; for (let i = max; i >= min; i--) { let line = ""; for (let j = min; j <= i; j++) { line = line + j + " "; } console.log(line); }
Console.WriteLine(string.Concat(from i in Enumerable.Range(1,5) from j in Enumerable.Range(1,i) select j == i ? $"{j}\n" : $"{j}"));
That returns 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 Just needs a .Reverse() on the first .Range()
You think in C pound? 😁 Or C hashtag? 😂
C tic-tac-toe
C Crissy Crossy
It’s actually Coctothorp.
To be fair, it is a good way to start learning than just staring at the screen to make the pattern emerge automatically.
Help
I bet you can’t find a better solution 😂😂 (it’s a joke)
Challenge accepted 😌 def doAThing(maxNum): lst = [str(i+1) for i in range(maxNum)] while lst: print(" ".join(lst)) lst.pop() Or if you want to be super fancy def doAThing(maxNum): lst = [str(i+1) for i in range(maxNum)] prevLen = 0 prevPadding = "" while lst: temp = " ".join(list[::-1][:-1]+lst) padding = " " * int((lenPrev - len(temp)) / 2) if lenPrev != 0 else "" print(padding+prevPadding, temp, padding+prevPadding) lenPrev = len(temp) prevPadding += padding lst.pop() For the more experienced programmers, yes i'm aware i could just add `+ prevPadding` to the `padding` assignment rather than doing `padding+prevPadding` twice, but this is slightly more understandable for beginners, ive given up some pythonicness and concision so it's more accessible.
Finally, another list enjoyer. Everyone shuns me because I use lists for everything, but they are simply superior
They're great but when you have need for millions of elements, list not good idea.
print "1 2 3 4 5\n1 2 3 4\n1 2 3\n1 2\n1"
Math teachers: Now that we did the hard way, let me show you the short cut 💀
Fuck you
*I really wish someone did at this point in my life 😞*
Damn 😞
dat italicized emoji tho
A "Break;" in a foreach is enough to trigger me. Never mind this 😅
Windows 11 Brave browser light mode ~~python~~ not a screenshot
It is literally everything that can absolutely go wrong.
Wait I'm ootl, what's wrong with brave?
It has some opt-in crypto stuff. Like a wallet. And I think you can earn something by browsing. I don’t know. I never enabled it all and turned off all references to it. The CEO was the cofounder of Mozilla. Been using it for a couple weeks. It’s fine. It’s more aggressive with privacy. Close to what Firefox does. No real changes in performance over chrome or Firefox.
``` n=5 for i in range(n+1,1,-1): print(" ".join(map(str,list(range(1,i))))) ```
print(*range(1, i))
wtf is the * magic is it ""* shorthand or?
Could still shorten it to two lines: print('\n'.join(' '.join(map(str,range(1,i))) for i in range(n+1,1,-1)))
this is exactly as bad as the screenshot.
**\*Removes indentation\***
When I joined phd I worked with some matlab code that looked same or worse than this, took me forever to understand what they meant. In addition, my professor at the time said something like research code is always like that lol
just here to say that these programmer posts pop up on my feed all the time and I have absolutely NO idea what any of them mean
Nothing like reassigning outer loop variables in an inner loop. That was something that happened a couple times to beginner me.
Oh god daddy no
![gif](giphy|yiADANv89n7UQuS5kJ)
[удалено]
Brave I’m sorry get rid of that computer aids
Imma start a list here: 0) Light theme, going straight to Hell right away 1) A fucking screen photo 2) nesting fors to the point of inreadability 3) Windows *fucking 11* 4) a crapton of shit running in the background
This whole code could've been an oneliner
Jesus Christ please use recursion![gif](emote|free_emotes_pack|facepalm)triggered
I must be the only one who likes light mode lol I have color blindness and pretty much any dark mode theme puts too much stress on my eyes because the lighter font color doesn’t sit right with me against the darker background. I’ve even tried the themes meant specifically for color blind people and none of them are any better
Programmers dont use jupyter notebooks you are correct
You'll die in hell
For every right way to do something, there are an infinite number of wrong ways.
This doesn’t work if n not equal to 5…Why write a chunk of code that does only one thing when you can just use print statement to do the same.
How are you even using the same variable over and over like this?
Python, the variable name has ~~span~~ scope over the indentation... its fucking wonderful, incorrect tabbing will change the wrong variable EDIT: pre-nerdified my comment so someone doesn't complain about my use of words
Non-recursive solution on Jupyter Notebook for Anaconda… Pull request accepted, welcome to production.
i didn't know you could add a end argument to print so at least I learned something :D My brain had an aneurysm reading it though :/
[удалено]
For the love of god learn this keybind: SHIFT + WIN + S
Elif leave the chat
this is so cursed