string - python password checker: numbers and symbols -


i'm new python , i'm having problem. need check password on upper, lower, numbers , symbols. needs 1 of each class , whole password needs longer 6 characters. have upper , lower case far. raw_input inputs string how can check numbers , symbols in string?

my code far:

p = raw_input(("plz enter password check it's strength"))  if len (p) <= 6:     if p.isupper() or p.islower() or int(p):         print"this weak password  " elif len(p) > 6 , len(p)  <26:     if p.isupper() or p.islower() or isdigit():         print "wea2k"     else:         print "good" 

so need know how check input numbers , symbols.

try this:

p = raw_input(("plz enter password check it's strength"))  upper_case = 0 lower_case = 0 number = 0 symbol = 0  in p:     if i.isupper():         upper_case += 1     elif i.islower():         lower_case += 1     elif i.isdigit():         number += 1     else:         symbol += 1  if len (p) <= 6:     print"this weak password  " elif upper_case > 0 , lower_case > 0 , number > 0 , symbol > 0:     print "good" else:     print "too weak" 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -