Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- possible = 0
- for pas in range(138241, 674034 + 1):
- pas = str(pas)
- rule1 = False
- for x in range(0, 5):
- if pas[x] == pas[x + 1]:
- if x == 0 and pas[x + 2] != pas[x]:
- rule1 = True
- break
- if x > 0 and x < 4 and pas[x + 2] != pas[x] and pas[x - 1] != pas[x]:
- rule1 = True
- break
- if x == 4 and pas[x - 1] != pas[x]:
- rule1 = True
- break
- if rule1 == False:
- # print("breaks rule 1")
- continue
- rule2 = True
- for x in range(0, 5):
- if pas[x] <= pas[x + 1]:
- continue
- else:
- rule2 = False
- break
- if rule2 == False:
- # print("breaks rule 2")
- continue
- # print(pas)
- # print("good")
- # print("-")
- possible += 1
- print(possible)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement