Arithmetic Operators in Python 3 - Sunshine and Rainbows

in #python6 years ago (edited)

Bobby the unicorn was bleeding rainbows from his ass. He ran to his mother crying, but she bitch-slapped him across the room. “Bobby, did you eat mommy’s acid again?”


For more NSFW Python 3 tutorials, visit Redheadedpython.com

A brief trip to the emergency room later and Bobby’s action figure was returned safely from his nether regions covered in rainbows. If Bobby hadn’t been such a dumb unicorn he would have used some basic math to figure out how much of mommy’s acid to drop. Let’s see how Bobby could use Python to prevent this from happening again:

Division operator: /

If Bobby had divided Captain Bunghole (his action figure) into 6 parts, they would have caused less damage to his rectum.

Addition operator: +

Instead, that horrible delinquent unicorn added 1 + 1 and it equaled one hell of a butt ache. The addition operator can both add integers or concatenate strings. Check out how to do that here.

Subtraction operator: Fuck off, you know this

In a fit of disgust, the doctor at the hospital hired a film crew to film him subtracting Captain Bunghole from Bobby’s rainbow-gushing brownie maker.

Multiplication operator: *

Do you need me to write another example on that? Probably not. * does amazingly look a lot like Bobby’s brown, err, rainbow-eye.

Modulus operator: %

Hahaha if you don’t know how to program you probably don’t know what the fuck modulus is. I guess it’s my job to explain it. It returns the remainder. Let’s go visit Bobby in school. His teacher is doing a shit job teaching him division. She states 10 / 7 equals 1 remainder 3. The modulus returns just that 3. Bobby’s teacher then told him don’t do drugs and stick toys up your sunshine dispenser. Bobby was too busy taking drugs like Ritalin to care.

Floor division: //

// is the opposite of modulus. Modulus gave you the remainder. Floor division gives you Rainbow Icecreamthe whole number in front of that remainder.

Let’s fast forward to Bobby’s future. He makes ice cream. And that’s why anything “rainbow flavored” tastes like shit to anyone older than 5 who can get past all the colors.