>>> dinner = pasta(["penne"])
A fine choice! Would you like to add ingredients?
>>> dinner.make(["red pepper flakes","sauciness"])
"Pasta created: Ingredients['red pepper flakes', 'sauciness']"
>>> dinner.eat()
Traceback (most recent call last):
File "", line 1, in
File "/var/folders/oX/oXfR780IGkmuopJgYla3-++++TI/-Tmp-/python-3803epT.py", line 89, in eat
__main__.SpicyError: "Ow! Man that's a hot pasta."
>>> dinner.remove("Red pepper flakes")
Traceback (most recent call last):
File "", line 1, in
File "/var/folders/oX/oXfR780IGkmuopJgYla3-++++TI/-Tmp-/python-3803epT.py", line 80, in remove
__main__.SpicyError: "Cannot remove Red pepper flakes from ['dinner']: Too damn hot."
>>> dinner.remove(rRed pepper flakes")
File "", line 1
dinner.remove(rRed pepper flakes")
^
SyntaxError: invalid syntax
>>> dinner.remove("red pepper flakes")
Traceback (most recent call last):
File "", line 1, in
File "/var/folders/oX/oXfR780IGkmuopJgYla3-++++TI/-Tmp-/python-3803epT.py", line 76, in remove
__main__.SpicyError: "I'm sorry, I can't remove red pepper flakes, they are too hot!"
>>> dinner.remove("red pepper flakes","please?")
Traceback (most recent call last):
File "", line 1, in
File "/var/folders/oX/oXfR780IGkmuopJgYla3-++++TI/-Tmp-/python-3803epT.py", line 71, in remove
__main__.SpicyError: "Sorry, I can't do that! It's too spicy!"
>>>
As an aside, it was actually very tasty, just super crazy hot. I think that may have been the holy trio of garlic, red pepper flakes and ginger.
3 comments:
This reminds me a bit of the Unix version of the war on terror.
Dang, I knew I should have kept up on my programming skills. I feel so out of touch...
Lidarose: Well, python is a great language for picking up programming again, actually - it's interpreted, which means you can have a session running and actually try things as you are figuring stuff out, rather than having to wait to compile and being stuck at compile errors and not knowing what went wrong. It's also a great high level language and is generally quite powerful in what it can do. I only picked it up recently (a year or two ago?) and it's already my default choice for tackling any general problem.
Naturally, many other languages are still better at their specific areas, but if you wanted one language to play around with for general usability, I'd go with python (2.6/2.6, though 3.0 is pretty stable now).
Post a Comment