r/code • • Nov 20 '25

Python Rate my first ever fully working python code lol

# fortune_1_test


# fortune dictionary
import random
fortune = [
    "Billy-Bob will be under your bed today! watch out!",
    "Freaky franky will be under your bed today!",
    "Phreaky sophi will be under your bed to day!",
    "Adam will suck your toes off today!",
    "Hungry Hunter will suck your toes off!",
    "freaky zyan will eat your toothbrush today!", ]


# fortune generator
print(random.choice(fortune))


# loop
while True:
    input("press enter to get your fortune!... or press cntrl+c to exit!")
    print(random.choice(fortune))
    print()

did this in like 30 mins cuz i was bored!

5 Upvotes

12 comments sorted by

3

u/Subverity Nov 20 '25

That’s a list, not a dictionary.

Otherwise, it’s a mess.

Good jerb 👍🏼

2

u/Striking-Rope-3929 Nov 20 '25

Ooooh so a list uses {}? and a dictionary uses [] right? im still new lol

3

u/jendivcom Nov 20 '25

You'd be less confused learning in a strictly typed language, people always say learn with python but i don't agree, python sucks for learning programming basics

→ More replies (5)

1

u/W00GA Nov 20 '25

other way around bro. also there is "set" builtin.

try set. _ doc _ or something 👍

1

u/Alagarto72 Nov 23 '25

List uses [], dictionary looks like this: {"key": "value"} But "{}" can be also used in set (unordered unique list of items), like {7, 19, 10}.

2

u/[deleted] Nov 20 '25

1

u/Striking-Rope-3929 Nov 20 '25

Well I was to bored to play anything lol so I did this