Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # increment_smallest_digit.py
- def increment_smallest_digit(chars):
- chars = list(chars)
- smallest_digit = min(chars)
- smallest_digit_index = chars.index(smallest_digit)
- incremented_digit = chr(ord(smallest_digit) + 1)
- chars[smallest_digit_index] = incremented_digit
- return ''.join(chars)
- import random
- sss = list('00112233445566778899')
- for i in '.'*20:
- random.shuffle(sss)
- s = ''.join(sss[:4])
- print(s, increment_smallest_digit(s))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement