Posts: 4,653
Threads: 1,496
Joined: Sep 2016
Jul-30-2019, 08:50 PM
(This post was last modified: Jul-30-2019, 08:50 PM by Skaperen.)
this is my coding challenge for July 2019. it qualifies to work if it runs correctly on at least one of the following versions of Python: 2.6.x, 2.7.x, 3.4.x, 3.5.x, 3.6.x, 3.7.x
code the smallest possible script that prints an exact copy of its own source code without reading any files.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,653
Threads: 1,496
Joined: Sep 2016
File "foo.py", line 1
File "foo.py", line 1
^
IndentationError: unexpected indent
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,653
Threads: 1,496
Joined: Sep 2016
i'm sure many of them work. i was trying to make a larger file. i osed the method of replacing the code with the output after it was run and did that a few times, checking that it wasn't alternating (a outputs b, b outputs a) and was the same each cycle. i posted what it converged to. i could change the file name in it.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,653
Threads: 1,496
Joined: Sep 2016
a more difficult problem: your code should output "BREAKING NEWS! WORLD ENDS!" at the end of the source it outputs.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.