Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sys import maxint
- def score_strings(dick, dildo):
- # compare the dick to the dildo, find the one closest to the real thing
- if dick is dildo:
- return maxint
- dick_len = len(dick)
- score = 0
- score_increment = 1
- dick_index = 0
- last_match = False
- for dildo_char in dildo:
- dick_char = dick[dick_index]
- dick_range = range(dick_index, dick_len)
- if len(dick_range) is 0:
- break
- for idx in dick_range:
- if dick_char is dildo_char:
- if not last_match:
- score = 1
- score += score_increment
- score_increment += 1
- dick_index += 1
- last_match = True
- break
- last_match = False
- return score
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement