r/madeinpython • • Jan 06 '21

Just started python, and I know this is a silly piece of code but I can't help but share it.

Just creates some sentences about poop using random adjectives. eg. "The smell of your first poop was absolutely cringe." Sometimes it doesn't make sense. I used sublime.

import random

poop_adj = ['round', 'liquid', 'sausagey', 'irregular', "like a bunch o' balls", 'smooth', 'spirally', 'cubic', 'like ice cream', 'incredible', 'unbelievable', 'quite lame', 'very lame', 'just lame', 'very very long', 'dark', 'light', 'bold', 'sexy', 'spongy', 'epic', 'legendary', 'sad', 'messed up', 'old', 'brand new', 'on fire', 'hot', 'amazing', 'majestic', 'cringe', 'solid', 'like pizza', 'like marmite', 'unbearable', 'heavy', 'totally bonkers', 'absolutely cringe', 'totally cute','just cringe', 'succesful', 'a failure', 'a success', 'shocking', 'a joke', 'like petrol', 'like asparagus', 'like fish', 'yucky', 'yummy'] # adjectives for your poop

poop_properties = ['texture', 'shape', 'colouring', 'smell', 'looks', 'excretion', 'size', 'shading', 'lighting', 'composition', 'destiny', 'weight', 'fate', 'length', 'width', 'view', 'features', 'quality', 'appearance'] # aspects for your poop

no = ['','','','',''] # idk how to make adjustable numbers yet ok

prep = ['next', 'following'] 

message = (f"( ͡° ͜ʖ ͡°) The {random.choice(poop_properties)} of your first poop was {random.choice(poop_adj)}.") # first sentence
print(message)

for n in no: # the number of sentences excluding first and last
	message = (f"( ͡° ͜ʖ ͡°) The {random.choice(poop_properties)} of your {random.choice(prep)} poop was {random.choice(poop_adj)}.")
	print(message)

message = (f"( ͡° ͜ʖ ͡°) The {random.choice(poop_properties)} of your last poop was {random.choice(poop_adj)}.") # last sentence
print(message)
25 Upvotes

8 comments sorted by

23

u/MAFiA303 Jan 06 '21

This is so shitty

2

u/n00bkill3r19 Jan 07 '21

You dont need the "no" list if you're just iterating through it for the amount of items in it (in your case: 5) You could instead write "for n in no:" as "for n in range(5)" this eliminates the need for the no list while also improving readability a bit.

Suggestion: You could initialize an empty list and append each iteration to a list, then print all 5 sentences at one time with a for loop similar to the one you have in the code for example: for n in no: print(no[n])

1

u/Rad-Hi Jan 07 '21

Thanks!

14

u/[deleted] Jan 06 '21

This is the pinnacle of pro coding

6

u/LordViaderko Jan 06 '21

for n in no:
=>
for _ in range(5):

5

u/[deleted] Jan 06 '21

You should make this your "Hello World" in every language you learn. I'm not kidding.

When I was a kid in the 80s, my mom taught me basic on an Apple II. The program she taught me is:

10 PRINT "WHAT IS YOUR NAME?"
20 INPUT NAME$
30 PRINT "WHERE ARE YOU FROM?"
40 INPUT PLACE$
50 PRINT "SEE YOU IN ";PLACE$;", ";NAME$;"!"

That's the program I first code in every language I learn. It's not much of anything, but it's a fair bit more than print "Hello World!", which barely teaches you anything.

1

u/[deleted] Jan 06 '21

I'd like to think that all my poops are equally sexy. I don't judge!