So you think you're cool, eh?
One Line Python challenge: Write programs using only a single line of Python. No newlines or semicolons.
Challenges:
Baby mode: Loop print integers 1 to 100
Easy mode: Fizzbuzz
Medium mode: Arithmetic parser and calculator.
Math mode: Write a program that estimates the values of integrals.
Hell mode: Define a Polygon and Square class, create a square instance and call some methods on it, do some polygon collison tests, etc.
Here's a freebie to start you guys off:list(map(print, range(1, 101)))
I couldn't be fucked trying to make it pretty or even more minimalist.for i in range (1, 101):print 'FizzBuzz' if not i%15 else 'Buzz' if not i%5 else 'Fizz' if not i%3 else i
>>51505223
>one line
>>51505223for i in range (1, 101):print 'FizzBuzz' if not i%15 else 'Buzz' if not i%5 else 'Fizz' if not i%3 else i
>Not using python3
>>51505631
> no semicolons
fails
>>51504921list(map(...))
Why did they have to do this? I want a strict map function again.
>>51504856
>one line
http://pastebin.com/gUBmYj8h
I know it's three lines (or 4 if you count the standard boilerplate), but I hope you can forgive me.
>>51505712
>http://pastebin.com/gUBmYj8h
What even is that?
>>51506193
Try it :^)
Note that when it ask for an upper bound, this a non-strict bound (because of an off-by-one error).
>>51506421
>non-strict
I mean strict.
>>51506421
Well, I mean that's impressive.
>>51506479
https://github.com/csvoss/onelinerizer
:|
>>51506490
>https://github.com/csvoss/onelinerizer
Not what I used, though. That's done by hand and a couple of Emacs macros.
Do your own homework faggot.