Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Creative category for I Love Python! by reviewboy
def i_love_python():
"""
Let's explain why do we love Python.
My dad brought home a TRS-80 in 1978.
It printed characters uppercase only.
It could show 24 lines of text at a time, 65 characters per line.
It came with a rudimentary version of BASIC that accepted abbreviations and only had
two string varables (A$ and B$).
It had a whopping 4,096 BYTES of RAM.
When you turned it on, the TV reception for most channels tanked.
Its RF frequency leak was so bad you could use an AM radio as a makeshift sound card.
There was no hard disk, no CD-ROM, no floppies. You read and wrote programs through
a basic cassette recorder's audio jacks, and heaven help you if the volume wasn't
EXACTLY in the right spot. You could almost type faster than the cassette I/O.
Did I mention it had BASIC? You turned the thing on, and after it warmed up and the
TV started going wonky, you got a nice "READY >"
It came with a manual: "BASIC Computer Language: It's Easier Than You Think!"
by David A. Lien
That manual took you step by step through the basics of BASIC, with a light comic
touch. There wasn't a lot your could do in 4096 bytes at a time, but for my
teenage self, it was a crash course in a magical new world. I laughed as I
learned. For the next several years, before floppies took off, we typed and
retyped and debugged source code from magazines. BASIC was interpreted, so you
knew instantly when there were problems.
Years passed, and we upgraded from TRS-80 to TRS-80. Later, I spent time in
Turbo Pascal, C, C++, but never with the same proficiency as my original, beloved
BASIC. I later had some success with Visual Basic 6, but it still wasn't the same,
and VB.NET scared me away again. I preferred testing to coding; it's so much more
fun to find problems than fix them; to review rather than create. At least in *those*
languages.
A bit of HTML here, some CSS there, some XML and XSLT and PHP, some scary moments in
Java and Perl and Javascript. Nosir, I don't like it.
Fast forward.
My company decides to use Python as a scripting framework for test automation. Off to
CodeAcademy and StackOverflow.
Hmmm...Python is interpreted.
Hmmm...Python is named after Monty Python. And it shows.
Hmmm...it's not BASIC, but it's got a personality.
Ummmm...it took me 27 lines to figure that out, and you can do ALL THAT in just
one line? AND it's readable?
Holy schnikeys! This is kinda fun!
Why do I love Python? It's restored my enthusiasm for coding.
"""
return "I love Python!"
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert i_love_python() == "I love Python!"
Oct. 1, 2014
Comments: