RSS
  • Python Powered

    16. Mai. 2010, 18:51

    http://www.python.org/download/releases/2.6.5/

    So, I've begun to play with it. If anyone who passes by is familiar, interested or can help with Python let me know. If anyone else would like to see the e-books and courses that train in Python let me know.

    Either way, I made a madlib from Hamlet's Act 3 scene 1. The famous, to be or not to be...

    a = raw_input("Please enter a verb: ") #verb
    b = raw_input("Please enter a noun: ") #noun 1
    c = raw_input("Please enter another noun: ") #noun 2
    d = raw_input("Please enter a plural noun: ") #plural noun
    e = raw_input("Please enter an adjective: ") #adjective
    f = raw_input("Please enter a plural noun: ") #plural noun 2
    g = raw_input("Please enter another plural noun: ") #plural noun 3
    h = raw_input("Please enter a verb ending in -ing: ") #Verbing
    i = raw_input("Please enter another verb: ") #verb 2
    j = raw_input("Please enter a noun: ") #Noun 3
    k = raw_input("Please enter a large number: ") #Large number
    l = raw_input("Please enter a professionor status: ") #job
    m = raw_input("Please enter a noun: ") #Noun 4
    n = raw_input("Please enter an adverb: ") #Adverb
    o = raw_input("Please enter a verb: ") #verb 3
    p = raw_input("Please enter a noun: ") #noun 5
    q = raw_input("Please enter a plural noun: ") #plural noun 4
    r = raw_input("Please enter a past-tense verb: ") #past-tense verb
    s = raw_input("Please enter an adjective: ") #Adjective 2
    t = raw_input("Last one! Please enter a noun: ") #Noun 6
    sa = "'To be, or not to "
    sb = ", -- that is the "
    sc = ";"
    sd = "Whether 'tis nobler in the "
    se = " to suffer"
    sf = "The slings and "
    sg = " of "
    sh = " fortune, "
    si = "Or to take "
    sj = " against a sea of "
    sk = ","
    sl = "And by "
    sm = " end them? To die, -- to "
    sn = ", --"
    sp = "No more; and by a "
    sq = " to say we end"
    sr = "The "
    ss = " and the "
    st = " natural shocks"
    su = "That flesh is "
    sv = " to,-- 'tis a "
    sw = " to be wish'd. To die, --- to "
    sx = ", ---"
    sy = "To "
    sz = ": perchance to "
    ssa = "! ay, there's the "
    ssb = ";"
    ssc = "For in that "
    ssd = " of death what "
    sse = " may come"
    ssf = "When we have "
    ssg = " off this "
    ssh = " coil,"
    ssi = "Must give "
    ssj = "....'"

    print sa+a+sb+b+sc #"To be, or not to "+a", -- that is the "+b";"
    print sd+c+se #"whether 'tis nobler in the "+c" to suffer"
    print sf+d+sg+e+sh #"The slings and "+d" of "+e" fortune,"
    print si+f+sj+g+sk #"Or to take "+f" against a sea of "+g","
    print sl+h+sm+i+sn #"And by "+h" end them. To die, -- to "+i", --"
    print sp+c+sq #"No more; and by a "+c" to say we end"
    print sr+j+ss+k+st #"The "+j" and the "+k" natural shocks"
    print su+l+sv+m+sn#"That flesh is a "+l" to, -- 'tis a "+m", --"
    print n+sw+i+sx#+n" to be wish'd. To die, --- to "+i",---"
    print sy+i+sz+o+ssa+p+ssb#"To "+i"! perchance to "+o"! ay, there's the "+p";"
    print ssc+i+ssd+q+sse #"For in that "+i" of death what "+q" may come"
    print ssf+h+ssg+s+ssh #"When we have "+h" off this "+s" coil,"
    print ssi+t+ssj #"Must give us "+t"...."