r/PythonLearning • • Aug 26 '25

Project - Password Analyzer

Topic - Project on what I've learnt so far

Hi all! Just finished this project which includes everything that I've learnt so far. Took 2/3 days but got there, honestly I'm really happy that I started it. I haven't included anything such as dictionaries yet (will be studying them next) but tried to include as much of lists and tuples I could. Any feedback would be highly appreciated as always, would love to hear others solutions to certain areas.

Thanks!

101 Upvotes

13 comments sorted by

View all comments

4

u/trustsfundbaby Aug 26 '25

You are using lists when you should be using sets. You use lists when you want to maintain an order and have duplicate values. For example special characters or common passwords, those are all unique and you don't care about the order, so they should be a set and not a list.

If you want to maintain order, for the special characters and common passwords you should be using tuples. You aren't adding to them later.

Why does it matter? Lists are slower than tuples and sets, because they do more. It doesn't matter here because you are initiating them many times and manipulating them, but its just good practice

1

u/ilikeraspberries123 Aug 27 '25

That makes so much sense, I struggled with not knowing when to use a list, set or tuple. I'll be implementing it in for my future projects as it's good practice. Thank you for explaining it so clearly!

2

u/trustsfundbaby Aug 27 '25

Whenever using the basic data structures (lists, tuples, sets, dictionaries) list should be the last choice even though most people pick them first.

1

u/ilikeraspberries123 Aug 27 '25

I'll start doing that to build up a good habit for the long run, thank you!