User:Inge Hoonte/madhatter: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with " import random accessories = ["musket", "fife", "drum", "coat", "hat", "shoes"] people = ["girl", "soldier", "wife", "hatter", "cobbler", "tailor"] from random import choi...")
 
No edit summary
Line 1: Line 1:
'''CODE'''
  import random
  import random
   
   
Line 7: Line 9:
   
   
  print """Oh""",choice(people),""",""",choice(people),""", will you marry me\nWith your""",choice(accessories),""",""",choice(accessories),""",""",choice(accessories),"""?\nOh how can I marry such a pretty little""",choice(people),"""\nWhen I have no""",choice(accessories),"""to put on?"""
  print """Oh""",choice(people),""",""",choice(people),""", will you marry me\nWith your""",choice(accessories),""",""",choice(accessories),""",""",choice(accessories),"""?\nOh how can I marry such a pretty little""",choice(people),"""\nWhen I have no""",choice(accessories),"""to put on?"""
'''RESULT'''
Oh soldier , hatter , will you marry me
With your shoes , fife , shoes ?
Oh how can I marry such a pretty little soldier
When I have no shoes to put on?
'''or'''
Oh soldier , wife , will you marry me
With your shoes , drum , drum ?
Oh how can I marry such a pretty little cobbler
When I have no coat to put on?
'''or'''
Oh soldier , wife , will you marry me
With your fife , coat , drum ?
Oh how can I marry such a pretty little hatter
When I have no coat to put on?
etc

Revision as of 14:43, 20 October 2011

CODE

import random

accessories = ["musket", "fife", "drum", "coat", "hat", "shoes"]
people = ["girl", "soldier", "wife", "hatter", "cobbler", "tailor"]

from random import choice 

print """Oh""",choice(people),""",""",choice(people),""", will you marry me\nWith your""",choice(accessories),""",""",choice(accessories),""",""",choice(accessories),"""?\nOh how can I marry such a pretty little""",choice(people),"""\nWhen I have no""",choice(accessories),"""to put on?"""


RESULT Oh soldier , hatter , will you marry me With your shoes , fife , shoes ? Oh how can I marry such a pretty little soldier When I have no shoes to put on?

or Oh soldier , wife , will you marry me With your shoes , drum , drum ? Oh how can I marry such a pretty little cobbler When I have no coat to put on?

or Oh soldier , wife , will you marry me With your fife , coat , drum ? Oh how can I marry such a pretty little hatter When I have no coat to put on?

etc