Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def decoder(new_list, split_list):
- password = ""
- for string in new_list:
- for pair in split_list:
- if string == pair[0]:
- print(string, "STRING")
- print(pair, "PAIR")
- password += pair[1] + " "
- return password
- def dice_roll(num):
- rolls = [[random.randint(1, 6) for i in range(5)] for i in range(num)]
- return rolls
- def format_rolls(rolls):
- new_list = []
- for roll in rolls:
- formatted_rolls = ""
- for num in roll:
- formatted_rolls += str(num)
- new_list.append(formatted_rolls)
- return new_list
- def file_open():
- with open("codes.txt", "r") as codes:
- line_list = codes.read().splitlines()
- split_list = (item.split("t") for item in line_list)
- return split_list
- def decoder(new_list, split_list):
- password = ""
- for string in new_list:
- for pair in split_list:
- if string == pair[0]:
- print(string, "STRING")
- print(pair, "PAIR")
- password += pair[1] + " "
- return password
- if __name__ == "__main__":
- print("Your new password is:",
- decoder(format_rolls(dice_roll(int(input("Number of words: ")))),
- file_open()))
- 11122 able
- 11123 abnormal
- 11124 abrasion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement