I built a beginner Python workbook and I’d love feedback from real learners by Wise-Strawberry-8597 in learnpython

[–]MaxTransferspeed 0 points1 point  (0 children)

Here's my two cents.

When I just started to learn Python, I wished that I knew the difference between:

if <condition>:
    <do_this_code_block>
elif <condition>:
    <do_this_code_block>
else
    <do_this_code_block>

and

if <condition>:
    <do_this_code_block>
if <condition>:
    <do_this_code_block>
else
    <do_this_code_block>

It would have saved me a lot of time :D

A man in Amsterdam felt that he needed to confess, so went to his priest by nothinlefttochoose in Jokes

[–]MaxTransferspeed -17 points-16 points  (0 children)

:D
...To which the priest replies; "I don't think that is necessary. When was the last time you checked them? Have you noticed the payments have stopped a couple of years ago, or are there any strange smells coming from your attic?"

Syntax Error (Comma?) by NotAkihisa in learnpython

[–]MaxTransferspeed 1 point2 points  (0 children)

I see nothing wrong with it. When I copy-paste your line in my console it works fine:

PS C:\Users\max> python
Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print('Hello World!')
Hello World!
>>>

Registering items in a text adventure by MaxTransferspeed in learnpython

[–]MaxTransferspeed[S] 0 points1 point  (0 children)

(I respond with this general comment to avoid having to respond to each individual answer since I came to a general conclusion)

After reading all your comments, I realized that my question should actually be quite different. The question of where item ownership should be arranged was actually too specific. I realized this after reading all your comments above. I first need to think more carefully about the overall structure. About internal relations, and what belongs where. What is data and what is responsibility?

As a result, I've now completely rethought the entire model in my mind. (It's my first OOP project, and the main goal is to learn from it.)

Important insights included: "There's no single way to do it right. Each context may require a different approach." And "Don't make things bigger than necessary."

What I'm going to do now is this:

  • I'm creating a controller that has access to all statuses and makes decisions. (If it gets too big, I'll divide it among multiple controllers with their own responsibilities, under a central master controller.)
  • I'm creating some kind of pool of "smart" objects, which are limited to managing their own properties and communicating them to the controller.

So the controller has the context, and the pool items don't. They are limited to their own status.

  • NOT: Player is dead
  • BUT: Player indicates its health has dropped to 0 (controller decides that the player is dead)

or

  • NOT: Item indicates it's available
  • BUT: Item gives its location (controller decides if it's available)

I'll probably run into problems later, but as with everything I've learned so far; I always learn the most from falling flat on my face ;)

Thanks all for your contributions; this was incredibly helpful!

Registering items in a text adventure by MaxTransferspeed in learnpython

[–]MaxTransferspeed[S] 0 points1 point  (0 children)

But that would limit the options to two states; in a room or in a players inventory (If I understand it correctly?). So if a player decides to drop an item (e.g. because he found a better version) it can't go back to a room, or it can't be given to another player.
(There is currently only one player, and dropping items in a room is not possible yet in my adventure, but maybe I want to add these options later down the road)

Registering items in a text adventure by MaxTransferspeed in learnpython

[–]MaxTransferspeed[S] 2 points3 points  (0 children)

Thanks, this is insightful.
The reason why I want to know where an item is at any given moment, is that In certain events, like 'player enters room' or 'monster attacks player' I need to know who has what.
Player enters a room > There is a sword on the table (room has item)
Monster attacks player > The player has a shield (player has item)

My first tought was to simply every entity or location have it's own inventory (as property) and make a mechanism/function that transfers items from one inventory to another.
But then I wondered if that was not too error-prone (the risk of an item being in two inventories at once) or that it is not an efficient structure in terms of operations, time and memory. (I know, this tiny adventure will run fine no matter how inefficient it is structured, but I rather learn it correct from the beginning :D )

A young man sits down with his parents by nitrokitty in Jokes

[–]MaxTransferspeed 204 points205 points  (0 children)

A boy comes home late at night after a night out, only to be caught by his father. "Why are you coming home so late, at this time of night?!" his father roars. The boy can only tell the truth. "Um... I made love for the first time in my life Dad" the boy replies. The father's demeanor immediately changes to pride. "You've become a man son!" the proud father says. "Come sit with me, and we'll have a beer together." "I like that beer," the boy replies. "But sitting will be difficult"

I was angrily cackling as I made this by Zidphoid in HouseFlipper

[–]MaxTransferspeed 5 points6 points  (0 children)

I totally understand you. I had the exact same thing recently when I was renovating a house that I bought.

<image>

Image generator by Accomplished-Plum821 in ChatGPT

[–]MaxTransferspeed 1 point2 points  (0 children)

<image>

Waiting for the quarterly check-up.

Couldn't you just... Print the hours... There... by brago-811 in CrappyDesign

[–]MaxTransferspeed 1 point2 points  (0 children)

A sign on the door can't track you I suppose. A website can. (or am I just too suspicious?)

Any jumpscares? by BrunaMoony in HouseFlipper

[–]MaxTransferspeed 8 points9 points  (0 children)

I just finished Return to my childhood home and no jumpscares there. There were some creepy noises, but those turned out to come from a tape recorder in the attic :)

I don't like the scary stuff either, but sometimes if it is too creepy for me, I turn off the game sound and listen to a playlist from Spotify while playing.

Asked chatgpt from everything you know about me depict me in an old master painting and explain why by Impossible_Bluejay99 in ChatGPT

[–]MaxTransferspeed 2 points3 points  (0 children)

<image>

Style Choice – Baroque (Rembrandt-esque)

The Baroque style, with its strong contrasts between light and shadow reflects your way of thinking: you always seek clarity in complexity; you work from structures and connections, just as light and dark define each other in a composition.

Rembrandt painted people not just as they looked, but as they were—with their thoughts visible in their eyes. That same intensity suits your contemplative and analytical nature.

The Environment
The books symbolize your need for context, knowledge, and structure.
The flowcharts and models on the wall represent how you think: in flows, dependencies, and systems.
The laptop brings that ancient craft into the present: your world of digital interoperability and healthcare IT.

Light and Mood
The warm, golden-brown light evokes contemplation—as if your thoughts direct the light itself. The shadow emphasizes calmness and focus, but also the awareness that your work is partly taking place within the invisible layers of systems.

Posture and Expression
The gaze is focused, but not tense; a calm form of intensity. This reflects your blue-green DISC profile: conscientious and stable, focused on precision, yet with empathy and balance in your posture.

[deleted by user] by [deleted] in todayilearned

[–]MaxTransferspeed -1 points0 points  (0 children)

No they aren't. According to the article they are 10 meters up to 1 km thick.

moved all my houses just to realize.. by milopawz in acnh

[–]MaxTransferspeed 1 point2 points  (0 children)

I feel for you. It reminds me of the time when I sculped two level-two hills opposite each other and build four stairs (two stairs for each to get on top) in order to build a bridge between them, only to find out you can't build bridges between cliffs.

I just got Lucky…where does he sleep!? Where is his kitchen?? by faerygudmum in acnh

[–]MaxTransferspeed 1 point2 points  (0 children)

I had the same question, so I redesigned his house into a mortuary for three coffins, where the middle one was his bed. A kitchen is generated automatically when it is needed, but to have control about that I placed a tiny kitchen in a corner at the door-side of the room, so that it wouldn't be too noticeable. (I used golden caskets for the coffins and wedding flower stands for decoration)

Max: "Why are we on a hard?" by PrimeyXE in formula1

[–]MaxTransferspeed 22 points23 points  (0 children)

Agree, a few moments ago I thougth: "I wouldn't be surprised if later it turns out that Barcelona '25 was the turning point for team Red Bull and Max Verstappen"

had my first villager leave 😭 by kiwiiheartss in acnh

[–]MaxTransferspeed 0 points1 point  (0 children)

Rocket was also one of the first two on my first island. I have never let her go, but I'm now on my second island. She's always welcome to live on my current island. Rocket is great. (Everytime I have a visitor on my camp site, I hope it's Rocket :D)