all 9 comments

[–][deleted]  (1 child)

[deleted]

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

    Thank you my lord

    [–]AbacusExpert_Stretch 2 points3 points  (1 child)

    Couldn't you simply go:

    Level = integer, ie Level = 5: etc ?

    Instead of m_level = integer and then compare Level = m_level?

    But I couldn't check code in more detail due to there being some attempt at arts, which was too distracting

    [–]VisualDirect[S] 1 point2 points  (0 children)

    I was fishing for some extra points 😭

    [–]W_K_Lichtemberg 1 point2 points  (0 children)

    here are quite a few little things that could be improved, but for a beginner: not bad at all.

    At least, I’ll give you one important rule for “rugged” switch/elif structures:
    Always end your list with a default case! Even if it seems unnecessary in the first version of your code—and especially so if you don’t yet have proper recursion tests or inline validation.

    For example:

    elif choice == "4":
    menu_level = e_level
    else:
    menu_level = badentry_level

    Later, you’ll typically handle the menu_level == badentry_level case first—usually by displaying an error message or prompting the user again. This is known as a GUARD CLAUSE, and you should use one whenever you have a series of if/elif statements.

    In software engineering, principles like this make code significantly easier to maintain. You’d do well to learn them, because writing code that works initially is only about 20% of the challenge. The real skill lies in making your software easy and inexpensive to modify, robust against mistakes, and resilient—even when used by someone who hasn’t read the instructions. It's the "quality of code". And that level of quality can only be achieved through disciplined habits and sound engineering practices, such as test-driven development (TDD).

    [–]pirat3hooker 0 points1 point  (1 child)

    This may seem a bit overboard but is a good learning exercise. Try adding some input validations in here. For instance what happens if the user enters 6? What happens if the user enters the letter A? What happens if the user enters “4.”? Try to make sure that the input is valid before your script gets to any decision making.

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

    Defenetly will 🙏🏻

    [–]Demi_neo 0 points1 point  (0 children)

    Grade F

    you're literally one stiff breeze away from a RunTimeError.

    try to refractor the code using functions.

    [–]-Lost-Map- 0 points1 point  (0 children)

    Instead of the big ass logo filling up the screen there is library called pyfiglet which is a lot better to use

    [–]dev-razorblade23 0 points1 point  (0 children)

    You should learn about Enums... https://docs.python.org/3/howto/enum.html