Breasts: A Python Tutorial. (Comedy Open Mic Round #29)
(Excerpted from my forthcoming book Learn to Program Humans with Python, not to be confused with the 1978 Lawrence Block and Robert Silverberg classic Learn to Program Humans with Pythons, which is a very different sort of book.)
As a beginning human programmer, it's important to start simple. In most languages, we start with a program called "Hello World," but your prototype human will not be capable of running that program until you've done some basic installation and training, and let it run for several months. Human programming is not for the impatient!
Instead we start with a very simple, single conditional:
if this.is_boob():
grab(this)
This isn't just the basic program for humans, it's the basic program for all mammals. Remember this if you acquire a prototype rhinoceros, muskrat, or polar bear! If your human does not learn this it will likely fail to progress far enough to run more complex programs.
While you may have to run this program manually a few times until the human gains abilities, before long you will be able to introduce the concept of loops. Most managers of prototype humans attempt this simple "for"-style loop:
for boob in mom:
grab(boob)
However, prototype humans have a tendency to develop emergent properties, and the end program often looks more like:
for boob in any_woman_available:
grab(boob)
or even
for boob in any_woman_available:
grab(boob)
else:
grab(manboob)
Truly precocious prototype humans will progress beyond "for" loops into the "while 1" loop used to keep a program running at all times, and implement:
while 1:
if this.is_boob():
grab(this)
This is a particularly dangerous program, especially as it may persist into adulthood. If it does, your prototype human is at risk of being committed to the git repository and spending the rest of his life doing pull requests. Thus it's important to break him of this habit early, by liberal disciplinary usage of the "break" statement to end the loop.
while 1:
if this.is_boob():
grab(this)
if this.is_not_yours():
break
As your prototype human matures, you'll begin to use Python libraries to train it, and one of the most important libraries is the "consent" library.
from consent import explicit_permission
while 1:
if this.is_boob():
if explicit_permission(this):
grab(this)
else:
continue
United States Senate photo. Public domain.
while 1:
if this.is_butt():
if location == "state fair":
grab(this)
This production human naturally had to be taken off-line immediately. Don't let this happen to your production human! Keep your consent library updated!
Error checking is also mandatory, especially when you are preparing to remove your access permissions from your prototype human and allow it into production. Python error checking is done with a "try-except" structure:
while 1:
try:
if this.is_boob():
grab(this)
except:
print insincere_apology
continue
The above is the most common error-checking routine in current production humans, but is now generally considered poor programming practice, and has been deprecated in favor of the consent library. However, even with the consent library corruption can occur:
while 1:
if anyone.is_looking():
get_consent()
else:
grab(boob)
Therefore, error checking is still appropriate:
while 1:
try:
get_consent()
grab(boob)
except:
print gracious_acceptance_of_no
break
Always stick to good programming practices, lest your human end up here: in the Git Repository.
By © User:Colin / Wikimedia Commons, CC BY-SA 4.0, Link
Please pre-order the book if you would like to read the rest of the chapter, about Ball Python.
I nominate, um, how about my fellow SBI moderators @rishi556 and @kiwijuce3.
Hi tcpolymath,
Thank you for your entry in to #comedyopenmic comedy contest. We have asked the judges below to review your entry and give it a funny rating. (They generally have no sense of humor, as the saying goes, those that can't do, start contests and judge).
This will determine your ultimate position when the results are tallied. (That being said, you are free to adopt any position you wish - we can recommend pantsless with beer in hand.)
Judges:
If you have any questions or queries please feel free to contact one of the judges or come say hi in discord: Click Here
Thank you to @matytan for the great banner
Judges, I think we found a winner. Give this man a trophy.
I think I'm gonna end up dead cuz of this. I don't know what I loved the most. The more I read, the harder I laughed. Think my favorite part was:
I had a feeling you were the core audience for this one.
I love comedy. I love programming. Was it aimed right at me?
Not until I got to the bottom and had to think about who to nominate. It's just what happens when I spend a week in Python.
Better than javascript. Wrote in swift again this week after a break from it and I was so glad.
Oh, Python is fun, it just does weird things to my brain.
I spent a brief and dark period of my life as the go-to Delphi programmer for a company that didn't use Delphi but occasionally got code from their vendors. I knew Pascal, but basically had to figure out Delphi on the fly from undocumented vendor code.
So it's hard to scare me with modern languages.
Thats the best way to learn something. Be forced to learn it. Thats what happened to me with JS and Python. But I like python and hate JS.
Also, don't you love it when you can't spell? Literally been working on 2 bugs since you posted this and the both were caused by spelling errors.
Ahhhh that was fun. And lol at Al Franken. Just a little disappointed he's no longer there (not condoning his lack of consent)
Consent is very important. And just the other day I verified that drunk consent is not necessarily consent, so make sure that's in that library too.
At the State Fair!
At the State Fair, Al!
For Pete's Sake!
(That part is a Big Deal here.)
Well, I have always wondered what my genetic code looks like.
I need wonder no more.
Acceptance is the first step.
Please tell me you are actually writing a book titled Learn to Program Humans with Python.
Well, I wasn't.
I smirked reading this, but I also felt sad for the state of humanity.
I think there's an error in your final piece of code. It should be "get_consent(boob)"
I'm actually not a coder, so I could be wrong. I am curious if I was following along enough to understand how to correctly code though. :)
It could be get_consent(boob), though I had envisioned get_consent() as a more general procedure than explicit_permission() which, as you can see in the earlier example, takes a body part argument. Probably get_consent() takes a Person object, if anything, but objectifying people tends to be troublesome in this context.
Ahhh, I see what you're saying. Like I said, I'm not really a coder, so although I might understand a little of it, I could be totally off-base. Ha ha.
Yeah, don't get yourself in trouble. Best to keep things clean.
Well I'm a newbie when it comes to coding humans. I simulated this code and the outcome behaves like @buttcoins.
That's worrisome, but I'm not sure I'd categorize it as a bug per se.
Hello! Your post has been resteemed and upvoted by @ilovecoding because we love coding! Keep up good work! Consider upvoting this comment to support the @ilovecoding and increase your future rewards! ^_^ Steem On!
Reply !stop to disable the comment. Thanks!
I will have to write more Python tutorials like this in the future.
This is a nice post. The above is the most common error-checking routine in current production humans, but is now generally considered poor programming practice, and has been deprecated in favor of the consent library.
It is a nice speech to cover all the post.
Hi @tcpolymath!
Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation! Your UA account score is currently 4.267 which ranks you at #2456 across all Steem accounts.
Your rank has dropped 15 places in the last three days.
In our last Algorithmic Curation Round, consisting of 206 contributions, your post is ranked at #51.
Evaluation of your UA score:
Feel free to join our @steem-ua Discord server