homework_on_password_conditions_unsolved

# -*- coding: utf-8 -*-
"""

@authors: katkaranikola stkarlos
"""

s = raw_input('give a password: ')

f1 =                    # has 2 !
f2 = 			# has at least one @
f3 = 			# has length between 6 and 10 characters -> [6,10]
f4 = 			# the first and the last characters are different

g1 =                    # has less than 3 $
g2 = 			# has at least two #
g3 = 			# has length larger than 9 and smaller than 15 characters -> (9,15)
g4 = 			# the first and the third from the last characters are the same

k1 =                    # has characters a or b or e on position 3 
k2 = 			# has more ! than &
k3 = 			# has odd length -> e.g. 1,3,5,7,9,11...
k4 = 			# the first three characters are different between them  

r1 =                    # has even sum of both @ and !
r2 = 			# has no @ or exactly 2 *
r3 = 			# has length smaller than 6 or larger than 11 characters
r4 = 			# the last character is a digit

if (f1 and f2 and f3 and f4) or (g1 and g2 and g3 and g4) or (k1 and k2 and k3 and k4) or (r1 and r2 and r3 and r4):
  print "accepted"
else:
  print "not accepted"

 

Posted in Uncategorized