Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+32 votes

Does anyone understand what "Mr.Hannaldous" is trying to do? In other words, for problem 2 on the lab, does anyone understand what the code is trying to do? I don't even know if the initial results from the original code is correct...
Thank you so much.

asked in CSC285_Fall2018 by (8 points)

1 Answer

+15 votes

You may assume that the original how_bad method does produce correct results.

Your goal is to refactor it: to make the code more elegant without changing the external behavior.

In terms of what Hannaldous' code does, a hint is that it has something to do with evaluating passwords.

answered by (17.9k points)
+7

So the good password should only be made of letters?

+11

at first I thought the same as you too, April.
but his howbad method actually count how many passwords that are considered as "bad", which are either made of all letters or less then the length "n" in the parameter.

...