« first day (2939 days earlier)      last day (2201 days later) » 

01:23
@Anush zip(*M)[1]
01:44
In Python 2. For 3, you gotta use list(zip(*M))[1]. And even that returns a tuple, so call list on all that. Once you've reached this point, you might as well go back to the list comprehension.
 
1 hour later…
Anonymous
03:14
@Khuldraesethna'Barya Or list(next(zip(*M)))
Anonymous
Oh wait, that still returns the first column...
list(...) => [*...]
Anonymous
Good point
Anonymous
[*[*zip(*M)][1]]
6
Anonymous
That's disgusting
03:16
it's the same size as [i[1]for i in M] :(
Anonymous
If Python did a nice thing and defined iter.__getitem__= lambda s,x:itertools.islice(s,x.start, x.stop, x.step), then it could be a lot cleaner
04:45
does anyone know where the newline is coming from in this code?
because if I uncomment out the print stuff afterwards, it mysteriously disappears again
Anonymous
@JoKing No, that's very perplexing. On an unrelated note, you can remove the space between print and ' for -1 byte
thanks
yeah, I saw @ØrjanJohansen notice it on this answer, but only figured it what was happening when i was writing my own answer
Anonymous
There's probably some weird interaction between print, input, and exec in 2.7
the other answer didn't have exec
when I remove input() it still happens
Anonymous
Thankfully it can be easily ported to Python 3 to dodge the issue entirely: tio.run/##K6gsycjPM/7/…
04:59
when I remove exec it still happens...
so i guess it's just print. Weird
@Mego but 15 bytes longer though
:(
Anonymous
Anonymous
Oh but that still has the newline issue because I forgot commas
Anonymous
Even with commas, it still prints an extra newline
i think the comma only delays the newline printing, rather than actual stopping it
Anonymous
I think flushing stdout at the end causes it - just print 1, alone prints 1\n
Anonymous
05:03
I think so too
Anonymous
It seems that it simply writes the string into a buffer, which later gets flushed with a newline
Anonymous
Whereas py3's print actually works as expected
Anonymous
You'd have to work around it by using sys.stdout.write instead of print, which is way too many bytes
sigh, i'll stick with python 3
oof yeah, 64 bytes
you know what, hacky solution time
print => input
look mama, no newline
 
3 hours later…
08:27
@Mego that's amazing!
 
2 hours later…
10:23
0
Q: The Highest Dice

Kevin CruijssenChallenge: Here we have the first 100 items of a sequence: 6,5,4,3,2,1,66,65,64,63,62,61,56,55,54,53,52,51,46,45,44,43,42,41,36,35,34,33,32,31,26,25,24,23,22,21,16,15,14,13,12,11,666,665,664,663,662,661,656,655,654,653,652,651,646,645,644,643,642,641,636,635,634,633,632,631,626,625,624,623,622,...

 
1 hour later…
11:39
0
A: Sandbox for Proposed Challenges

Jo KingEww, those bytes are gross code-challenge restricted-source Write a program/function that, when given a string, filters out as many bytes as it can and returns the cleaned string. However, since your program hates them, none of these bytes can be present in your own code. Your score will be th...

 
3 hours later…
14:51
2
Q: The Great Pyramid of Quine

Magic Octopus UrnThe task is a rather simple quine challenge with a twist, you must output your source code in the shape of a pyramid. The shape of a pyramid is defined below: 1 234 56789 ABCDEFG HIJKLMNOP QRSTUVWXYZa bcdefghijklmn ......etc...... The main limitation of this challen...

15:04
0
A: Sandbox for Proposed Challenges

Luis felipe De jesus MunozMeasuring resistance In this challenge we are going to be measuring the total resistance of a circuit. A circuit looks like this: ┌─┬─┐ ┌─┐ ┌─┬─┐ or │ │ # ╪ # or ╪ # # or ╪ # │ └─┘ └─┴─┘ or │ │ # └─┴─┘ Where ...

0
Q: Cell phone Charge

Luis felipe De jesus MunozChallenge Taken with permission from my University Code Challenge Contest The dependence we have on mobile phones makes us charge them every night up to the maximum level of the battery, so we do not run the risk of running out of it by the middle of the next day. There are even people who, wh...

 
2 hours later…
17:29
0
Q: Return Spiral Indexes!

KrystosTheOverlordSpirals are cool , so are numbers, and number spirals are even cooler. But what if I want a specific number, in a specific place using xy coordinates... Challenge Using an infinite spiral moving down first, curling in a counterclockwise manner ex: 6 5 4 7 0 3 8 1 2 9 10 11 Take n...

18:00
-3
Q: Coding Challenge - Winner gets Amazon Gift Certificate

John F GnazzoSolve this for a change to win a 25 dollar Amazon Gift Certificate https://www.teamscs.com/2019/02/scs-coding-challenge-47/ Tuple The Tuple class was introduced in .NET Framework 4.0. A tuple is a data structure that contains a sequence of elements of different data types. It can be used where ...

 
3 hours later…
@AdmBorkBork That looks like an answer to this PPCG question. Python in Java.
Haha, nice.
21:22
0
A: Sandbox for Proposed Challenges

AdmBorkBorkASCII Podiums code-golf ascii-art This is my Socratic challenge! :) To celebrate that, along with my being one of the top ASCII-art challenge writers, here's another. Yay! In sporting competitions, it's often that winners are presented on podiums, with the first-place person on the highest in ...

 
1 hour later…
Anonymous
22:51
0
A: Sandbox for Proposed Challenges

Erik the OutgolferDoes this addition pyramid puzzle have a unique solution? code-golf decision-problem arithmetic Given an addition pyramid \$P\$, determine whether it can be solved. An addition pyramid consists of a layers, each having one less number than the one below it. Layer \$i\$ is symbolized as \$P_i\$. ...

23:35
@Mego nice 404...
Anonymous
@EriktheOutgolfer ?
the link in ATaco's message is a 404
Anonymous
Not for me
hm, because pausing the ad blocker (or going to incognito) doesn't solve the issue

« first day (2939 days earlier)      last day (2201 days later) »