Ask coding questions

← Back to all posts
Setting a Password
nicklee11 (4)

Not sure what to do on line 5 and 6...any suggestions?

Answered by mat1 (4429) [earned 5 cycles]
View Answer
mat1 (4429)

You can check the length of a string by doing len(string), and you can compare lengths by doing int1 > int2 in your case, this would be while len(password) < 8 or len(password) > 15:
Please upvote my comment if it was helpful or useful. Thanks!

nicklee11 (4)

@mat1 Thanks that worked! But would you know why my error messages wouldn't pop up? on line 12, also if I did enter correct, "password has been set" isn't popping up. Any idea what I did wrong?

mat1 (4429)

@nicklee11 You can check if two variables are equal with ==, for example; if password == password_confirm:. Also, in line 13, found is set to False which causes the next if statement to fail and not print anything.
Please upvote my comment and mark it as the answer if it was helpful or useful, thanks!

moudy (114)

@nicklee11 not sure if you saw the update but you can now accept comments as having answered your question. See the announcement for more info.

Is there something we could change to make this feature more noticeable?