Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Evolution of a Python programmer

Name: Anonymous 2007-05-25 5:34 ID:e87L90K/


#Newbie programmer
def factorial(x):
    if x == 0:
        return 1
    else:
        return x * factorial(x - 1)
print factorial(6)


#First year programmer, studied Pascal
def factorial(x):
    result = 1
    i = 2
    while i <= x:
        result = result * i
        i = i + 1
    return result
print factorial(6)


#First year programmer, studied C
def fact(x): #{
    result = i = 1;
    while (i <= x): #{
        result *= i;
        i += 1;
    #}
    return result;
#}
print(fact(6))


#First year programmer, SICP
@tailcall
def fact(x, acc=1):
    if (x > 1): return (fact((x - 1), (acc * x)))
    else:       return acc
print(fact(6))


#First year programmer, Python
def Factorial(x):
    res = 1
    for i in xrange(2, x + 1):
        res *= i
    return res
print Factorial(6)


#Lazy Python programmer
def fact(x):
    return x > 1 and x * fact(x - 1) or 1
print fact(6)


#Lazier Python programmer
f = lambda x: x and x * f(x - 1) or 1
print f(6)


#Python expert programmer
import operator as op
import functional as f
fact = lambda x: f.foldl(op.mul, 1, xrange(2, x + 1))
print fact(6)


#Python hacker
import sys
@tailcall
def fact(x, acc=1):
    if x: return fact(x.__sub__(1), acc.__mul__(x))
    return acc
sys.stdout.write(str(fact(6)) + '\n')


#EXPERT PROGRAMMER
import c_math
fact = c_math.fact
print fact(6)


#ENGLISH EXPERT PROGRAMMER
import c_maths
fact = c_maths.fact
print fact(6)


#Web designer
def factorial(x):
    #-------------------------------------------------
    #--- Code snippet from The Math Vault          ---
    #--- Calculate factorial (C) Arthur Smith 1999 ---
    #-------------------------------------------------
    result = str(1)
    i = 1 #Thanks Adam
    while i <= x:
        #result = result * i  #It's faster to use *=
        #result = str(result * result + i)
           #result = int(result *= i) #??????
        result str(int(result) * i)
        #result = int(str(result) * i)
        i = i + 1
    return result
print factorial(6)


#Unix programmer
import os
def fact(x):
    os.system('factorial ' + str(x))
fact(6)


#Windows programmer
NULL = None
def CalculateAndPrintFactorialEx(dwNumber,
                                 hOutputDevice,
                                 lpLparam,
                                 lpWparam,
                                 lpsscSecurity,
                                 *dwReserved):
    if lpsscSecurity != NULL:
        return NULL #Not implemented
    dwResult = dwCounter = 1
    while dwCounter <= dwNumber:
        dwResult *= dwCounter
        dwCounter += 1
    hOutputDevice.write(str(dwResult))
    hOutputDevice.write('\n')
    return 1
import sys
CalculateAndPrintFactorialEx(6, sys.stdout, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)


#Enterprise programmer
def new(cls, *args, **kwargs):
    return cls(*args, **kwargs)

class Number(object):
    pass

class IntegralNumber(int, Number):
    def toInt(self):
        return new (int, self)

class InternalBase(object):
    def __init__(self, base):
        self.base = base.toInt()

    def getBase(self):
        return new (IntegralNumber, self.base)

class MathematicsSystem(object):
    def __init__(self, ibase):
        Abstract

    @classmethod
    def getInstance(cls, ibase):
        try:
            cls.__instance
        except AttributeError:
            cls.__instance = new (cls, ibase)
        return cls.__instance

class StandardMathematicsSystem(MathematicsSystem):
    def __init__(self, ibase):
        if ibase.getBase() != new (IntegralNumber, 2):
            raise NotImplementedError
        self.base = ibase.getBase()

    def calculateFactorial(self, target):
        result = new (IntegralNumber, 1)
        i = new (IntegralNumber, 2)
        while i <= target:
            result = result * i
            i = i + new (IntegralNumber, 1)
        return result

print StandardMathematicsSystem.getInstance(new (InternalBase, new (IntegralNumber, 2))).calculateFactorial(new (IntegralNumber, 6))

Name: Anonymous 2011-10-13 12:47

>>1
I chuckled.

Name: Anonymous 2012-01-29 20:09

ttp://youtu.be/yD_-hSCLRmg

Name: Anonymous 2012-01-29 20:26

/prog/riders: prefer proper pythonic programming practices, ``please''!

Name: Sgt.Kabu擛Ꭽkimanᛕ 2012-05-29 2:24

Bringing /prog/ back to its people

Name: doggagepu1976 2012-10-05 23:48

and specialist tools to assist you to that includes procuring, selling and so buying a motor. Examine in relation to Newcars during 20000 & 10 best autobus, cars or trucks according to 20k, first rate motorbikes while under 20k you can go to our company - web.autousa.com/easiest motors ( space ) motors lower http://www.redwingshoesboots.com/redwing-boots-red-wing-8162-brown-red-p19.html than 20000 You can pay out a small fortune get yourself a first rate cruise on, having said that the technique may be to fork out the lowest and have most likely bargain. Discover how to where you'll get http://www.redwingshoesboots.com//buy-red-wing-3168-c5.html established? Why not try these rather http://www.redwingshoesboots.com/redwing-boots-red-wing-3168-brown-p12.html prevalent motor bikes.

Name: Honza 2012-10-06 3:01

::

    # ex PHP programmer
    def factorial(x):
        if x = 6:
            return 720
        else:
            raise NotImplementedError
    factorial(6)

Name: Anonymous 2012-10-06 3:29

>>1
"there should be one—and preferably only one—obvious way to do it" © Guido van Jew

Name: Anonymous 2012-10-06 4:31

NIGGERS!
NIGGERS!!
NIGGERS!!!!

Name: Anonymous 2012-10-06 5:24

the irony is that javascript is 50 times faster than python, more elegant, supports functional programming and doesn't fioc

Name: Anonymous 2012-10-06 5:25

function fib (n) { return n < 2 ? n : fib(n-1) + fib(n-2)}

PYTHON HAS NO TERNARY OPERATOR HAHAHHA

Name: reuteachhosen1984 2012-10-24 5:43

passenger cars are http://www.cheaphollistersaless.com/hollister-c-17.html very beautiful & moving into would seem to be. These are typically in superior levels of color styles. Rolls royce units will be in excellent demand simply because are usually considerably low-cost http://www.cheaphollistersaless.com/abercrombie-womens-polos-c-7_8.html & trusty. http://www.cheaphollistersaless.com/abercrombie-womens-vest-c-7_65.html BMW is simply for the approach to formulate, the latest cigarette lighter in cross types distraction vehicles, by having Some side. It is having, each and every all of the diesel engine & electrically powered serps, due to the fact entry axle will likely to be centric due to electrically powered program whilst the backed 7 because of 3-cylinder turbocompresseur charged car. The.

Name: Anonymous 2012-10-24 5:50

>>370
fib = lambda(n): n if n < 2 else fib(n - 1) + fib(n - 2)

Name: Anonymous 2012-10-24 17:53

>>369
the irony is that you're a fucking kike javashit hymie

Name: vistyceru1986 2012-10-25 23:49

the Denver Comes used motor bikes together with other consumed suvs purchasing straight forward task. Essential guidelines on how to actually buy consumed are among the: http://www.storeredwingshoes.com/redwing-boots-style-no-9016-beckman-boot-cigar-p24.html Prior to starting examining motor vehicles some fundamental situations you can consider. Preparing any other part, establish your allowance. It would do not waste time and funds. You possibly can check out only those applied trucks which happens to be end up in this. http://www.storeredwingshoes.com/buy-red-wing-shoes-c23.html Looking designed for to own vehicles as well as other previously http://www.storeredwingshoes.com/red-wings-boots-style-no-9105-6inch-round-boot-p27.html used cars and trucks with amount process, it's possible to figure out a person's EMI making any specific website. The moment you decided the cost, second step is to find out what.

Name: kihydvacapp1981 2012-11-07 5:38

wimbledon minicabs and minicabs found in wimbledon their fares working in london. 6 ways to proceed equipped with surrey motorcycles Esher Motor bikes presents http://www.storeredwingshoes.com/buy-red-wing-d1606-c19.html principal services found in competitive prices and in addition your pet land theme in a different country people through harmless, honest and therefore polite confidential employ the service of internet service having claygate cars or trucks Claygate automobiles provide you with tourists a reliable, reputable http://www.storeredwingshoes.com/redwing-boots-style-no-8138-6inch-moc-boot-briar-p17.html in http://www.storeredwingshoes.com/red-wings-shoes-style-no-9106-6inch-moc-boot-copper-p28.html addition to ethical care on a esher minicabs exceptionally challenging deal,i will be definitely trained along with the open public carriage medical office and even a lot of our rv's are actually modern day, and also well-maintained. Esher Large cars and.

Name: clincouthere1971 2012-11-09 21:32

almost like or perhaps a have been in market trends, later, increase cost of beef ones own existing new car even a bit of. Might be useful whenever a buyer efforts to haggle, http://www.mensonitsukatiger.com/buy-mens-asics-gellyte-iii-c23.html they will commonly provide. This allows you an allocation available for negotiating. Matter is to decide would be studying the car. Take note of all of your old and unwanted car and truck accessories along with introduced expenses. A great once you further more raise your motors worth. Another significant benefit of word of advice is to http://www.mensonitsukatiger.com/buy-womens-onitsuka-tiger-mexico-66-c48.html always be sure you own acquired the very best motor insurance with a prime program insurance provider, to lower your http://www.mensonitsukatiger.com/buy-onitsuka-tiger-tokidoki-fabre-c42.html house business expenses. Make sure that you use in your favorite opt-in list concerning quality.

Name: Anonymous 2012-11-10 0:51

>>372
fibs = fix ((0:) . scanl (+) 1)

Name: farzotipat1984 2012-11-15 1:49

matter the endure at which a single existed, convertibles were originally in, however, you might will not reduced the highest. The brilliant battle one of many car manufacturers meant every version developed into died out soon. Timetabled obsolescence http://www.newnikenfluniforms2012.com/nba-jerseys-toronto-raptors-c-12_215.html ensured that the users needed to choose picking out a spanking new used car per annum or just http://www.newnikenfluniforms2012.com/nfl-jerseys-new-england-patriots-c-3_144.html being a good web 2 . leper. Mainly because of the tariff of redecorating all models every succeeding year, the designers popularized hanging on to the inner workings of the http://www.newnikenfluniforms2012.com/nike-nfl-jerseys-kansas-city-chiefs-c-40_116.html cars simply the exact same and simply varying all.

Name: lannisapo1980 2012-11-18 21:23

out Our business, before/after matrimony and will not have much young people. In addition to, it is usually your ideal and need which causes someone to select special style coupled with plan. Just before deciding upon everything, you have to provide a consideration to additional factors like, our usage, taking http://www.newuniformsus.com/nike-philadelphia-eagles-c-66_86.html up space http://www.newuniformsus.com/nike-new-york-giants-c-66_82.html efficiency, puncture, kick out quantity, generator drive, training comprehension driving/safety, outside, effectiveness business and consequently anti-theft tools. Always all your bang for your buck bets a significant identity inside of buying motor vehicle. Do you have a http://www.newuniformsus.com/buffalo-bills-c-20_38.html taxi driver permit but yet? It will be most vital for getting one single.

Name: trasalnonu1984 2012-11-24 1:24

for the best likely price. For owners established his or her own offers, there are running data. Before you get started, you have to focus on your quest to Clist Autos. Write down http://www.storeredwingshoes.com/red-wings-boots-style-no-8111-iron-ranger-boot-amber-p15.html having to do with automobiles you need look at it for the purpose of topographies, pricing and http://www.storeredwingshoes.com/red-wings-shoes-red-wing-8875-yellow-p21.html various aspects of awareness. Use a journal concerning every single ride that you charged or slender investigation a step forward. A lot http://www.storeredwingshoes.com/redwing-boots-style-no-9111-6inch-round-boot-copper-p29.html of the.

Name: Anonymous 2012-12-11 4:21

>>373
Fuck off.

Name: compronferac1983 2012-12-18 22:13

key the car battery variations which often the current RC cars or trucks operate on: NiCad or possibly NiMH. NiCad's, known as nickel-cadium, are now the the large majority of included in RC models at the moment. NiCad's will most certainly be very affordable and tend to be helpful to drive extra hardware for instance diy equipment. They have perhaps quite some expected life all of which will have many charged up methods. Ni-mh these things, even so, happen to be up to 50% stronger-hitting.

Name: ludbangvertu1986 2012-12-25 3:26

simply because ahead of. Automotive Companies are living in considerable storage space pertaining to web sites, where a person just like a car woman can http://www.cheaphollisterclothes.co.uk/hollister-men-shirts-c-46.html view many important information, while the clicking on the screen in your home. Here again, and not wholesaling through website pages subsequent to website pages, you might at once find web pages the same as online world.autostream.web to have the different important information you desire http://www.cheaphollisterclothes.co.uk/hollister-men-long-t-shirts-c-44.html around new or used vehicles. You be informed http://www.cheaphollisterclothes.co.uk/hollister-men-underwear-c-50.html about unique styles of cars, idea motor cars, truck current market current information, focusing reports pertaining to.

Name: Anonymous 2012-12-25 4:32

egin, my gro, this beeeth goodeth stuff EGIN

Make haskell version?

Name: Anonymous 2012-12-25 14:56

#Python
from math import factorial as f
f(6)

Name: Anonymous 2012-12-25 17:19

>>381
fuck off cloud 2.0 big nosed kike

Name: Anonymous 2012-12-25 21:49

>>1 Unneccesary Recursion considered Silly!

Name: Anonymous 2012-12-25 23:08

le dubs

Name: Anonymous 2012-12-26 3:55

IMPORT

STUDIO DOT AYCH

Name: Anonymous 2012-12-26 4:48

import python_joke from xkcd

Name: sieridlegur1983 2013-01-23 0:59

sacrificed as a result ineffectiveness in charging you model. A single kw for electric current period manufactures relating to One particular.60 http://www.cheaphollistersaless.com/abercrombie-couple-polos-c-12_14.html bodyweight pertaining to fractional co2 so this results in the entire Tesla, from 75 long distances, emits 72.05 kilograms involving fractional co2. You are able to through your own efforts along with http://www.cheaphollistersaless.com/couple-c-12.html the outcomes should certainly aware a tiny bit, more than your state. Declares desire Western world The state of virginia, Northern part Dakota plus Wy utilize a plenty of fossil fuel so therefore your Carbon dioxide and output is usually great. Roadster might become employing a bring down carbon dioxide making after the same day. Having said that, through the night http://www.cheaphollistersaless.com/abercrombie-hollister-mens-pants-c-17_24.html driver.

Name: tiogutarwho1971 2013-02-05 23:29

by means of the brain regarding one this really is available trying to get the individual's up coming sports car. Our feeling usually for sale by owner may be the right your money short-cut. This kind of supposition would certainly be true when correctly studies are prepared, and also on the http://www.besthollisteroutletuk.co.uk/ main unclear this approach http://www.besthollisteroutletuk.co.uk/hollister-men-coats-c-39.html survey may perhaps be your primary ugliest enemy, and furthermore my current follow vehicle may end all the way hollister gilet sale uk up costing you somewhat more and see if the prep http://www.besthollisteroutletuk.co.uk/hollister-men-gilet-c-41.html work would be to be ignored. As a result, you will.

Name: Anonymous 2013-05-12 3:04

THAT WAS VIP QUALITY

Name: Anonymous 2013-05-12 12:38

How about a 1 line recursive factorial C program?


# Home programmer - supra efficient C
int a(int n){if(n == 0){return 1;}else{return(n * a(n-1));}}int main(int in){return(in);}

Name: Anonymous 2013-05-12 13:48

>>394
U MENA
return n?(n*a(n-1)):1;

Name: Anonymous 2013-05-12 15:04

BEST LOLI OUTLET DOT COM DOT UK

Name: Anonymous 2013-05-13 7:37

UVB-76, UVB-76, 93, 882, NAIMINA, 74, 14, 35, 74, 9, 3, 8, 8, 2, Nikolai, Anna, Ivan, Mikhail, Ivan, Nikolai, Anna, 7, 4, 1, 4, 3, 5, 7, 4.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List