Python Forum
Syntax "for" loop, "and", ".isupper()", ".islower", ".isnum()"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Syntax "for" loop, "and", ".isupper()", ".islower", ".isnum()"
#4
Your code is not working properly.
It says "#....." or "$....." or "@....." are valid passwords, and that´s not true.
So only one check is working and that´s if there is a special character in the password,
all other checks are not working as you assume.

Maybe have a look here: https://docs.python.org/3/library/string.html
string.ascii_lowercase .ascii_uppercase and .digits might be interesting

think about the possibilities of using any():
https://docs.python.org/3/library/functi...ht=any#any

and combine that with using all()
https://docs.python.org/3/library/functi...ht=all#all

btw: input() returns a string, so no need to convert a string to a string using str()
Reply


Messages In This Thread
RE: Syntax "for" loop, "and", ".isupper()", ".islower", ".isnum()" - by ThomasL - Sep-06-2019, 12:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Syntax Error: Invalid Syntax in a while loop sydney 1 4,156 Oct-19-2019, 01:40 AM
Last Post: jefsummers
  SyntaxError: Invalid syntax in a while loop ludegrae 3 14,901 Dec-18-2018, 04:12 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020