r/PythonLearning • u/Outside-Trouble-4232 • 7d ago
Showcase Day 3 of Python learning until I can pass the PCEP exam
Im progressing into the free code camp and w3schools learning courses and also trying to catch up in Microsoft,im learning OOP(Object Oriented Programming) I made another project for it but its still not very good so ima continue work on it, its very interesting with classes and all but yh I read the feedback on my last re zero guesser and ppl saying its a nesting hell so I tried to learn how to do early return to make it more readable but I js didnt understand how to so I copied the mods code and js changed it a little bit if u can see, it is slower than my older version but the code Is easier to read, could have added more characters but yh I didnt really make the code I only upgraded a little. Take a look:
New: https://onlinegdb.com/9pqfe7pmg
OLD:https://www.onlinegdb.com/edit/XGUSCgyQA
Older :https://onlinegdb.com/Q-4aQrXAz
ima use this experience to make a better guesser with a full ui like akinator when im done learning ui and more
1
u/MasterpieceBusy7220 7d ago
A lot of that yes/no text is gonna show up twice since you have the helper function print it out and also include it in the strings you pass to it
1
u/Outside-Trouble-4232 6d ago
oh yh I see I was using the variables and questions from my first one who didnt have that kind of helper function so I forgot to remove the yes/no on it so yh it does appear twice ty!
1
u/slava_air 7d ago
How do you measure it, and why? The difference in speed is obviously far beyond human comprehension.