#๐ I need help on my assignment, theres this one question and i cant answer it
9 messages ยท Page 1 of 1 (latest)
Please react with โ
to upload your file(s) to our paste bin, which is more accessible for some users.
@echo hedge
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
i would
- move everything under
if __name__ == "__main__"into amainfunction - use type hinting and return types to make debugging and understanding the code easier
you could also add a seperate json file with stored questions that you add to the quiz on startup
ok ty
Some other tips,
- You use magic variable names in some of your for loops (e.g. i and q). Change these to be readable variables names.
- You can reduce nesting in password checker. You donโt need that first else as you break in the initial if statement.
- Using multiple print statements (one immediately after the other) when you can just use a single one can be expensive. You wonโt notice it for this program but in future ones itโs a better practice to combine them into a single print call. You can look into multi line strings to make it look nicer.
- You might want to add some docstrings to describe your methods.
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.