Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rotor_1 = "EKMFLGDQVZNTOWYHXUSPAIBRCJ"
- rotor_2 = "AJDKSIRUXBLHWTMCQGZNPYFVOE"
- rotor_3 = "BDFHJLCPRTXVZNYEIWGAKMUSQO"
- rotor_4 = "ESOVPZJAYQUIRHXLNFTGKDCMWB"
- rotor_5 = "VZBRGITYUPSDNHLXAWMJQOFECK"
- rotor_6 = "JPGVOUMFYQBENHZRDKASXLICTW"
- rotor_7 = "NZJHGRCXMYSWBOUFAIVLPEKQDT"
- rotor_8 = "FKQHTLXOCBJSPDZRAMEWNIUYGV"
- rotor_dict = {}
- selected_rotors = []
- for i in range(1, 3 + 1):
- rotor_data = input("Enter a number from 1 to 8 inclusive: ")
- rotor = ""
- while True:
- if rotor_data.isdigit() and 1 <= int(rotor_data) <= 8 and rotor_data not in selected_rotors:
- rotor += rotor_data
- break
- else:
- print("Invalid input")
- rotor_data = input("Enter a number from 1 to 8 inclusive: ")
- start_data = input("Enter a number from 0 to 25 inclusive: ")
- start = ""
- while True:
- if start_data.isdigit() and 0 <= int(start_data) <= 25:
- start += start_data
- break
- else:
- print("Invalid input")
- start_data = input("Enter a number from 0 to 25 inclusive: ")
- if int(rotor) == 1:
- rotor_1 = rotor_1[int(start):] + rotor_1[:int(start)]
- rotor_dict[i] = rotor_1
- selected_rotors.append(rotor)
- elif int(rotor) == 2:
- rotor_2 = rotor_2[int(start):] + rotor_2[:int(start)]
- rotor_dict[i] = rotor_2
- selected_rotors.append(rotor)
- elif int(rotor) == 3:
- rotor_1 = rotor_3[int(start):] + rotor_3[:int(start)]
- rotor_dict[i] = rotor_3
- selected_rotors.append(rotor)
- elif int(rotor) == 4:
- rotor_1 = rotor_4[int(start):] + rotor_4[:int(start)]
- rotor_dict[i] = rotor_4
- selected_rotors.append(rotor)
- elif int(rotor) == 5:
- rotor_1 = rotor_5[int(start):] + rotor_5[:int(start)]
- rotor_dict[i] = rotor_5
- selected_rotors.append(rotor)
- elif int(rotor) == 6:
- rotor_1 = rotor_6[int(start):] + rotor_6[:int(start)]
- rotor_dict[i] = rotor_6
- selected_rotors.append(rotor)
- elif int(rotor) == 7:
- rotor_1 = rotor_7[int(start):] + rotor_7[:int(start)]
- rotor_dict[i] = rotor_7
- selected_rotors.append(rotor)
- elif int(rotor) == 8:
- rotor_1 = rotor_8[int(start):] + rotor_8[:int(start)]
- rotor_dict[i] = rotor_8
- selected_rotors.append(rotor)
- print(rotor_dict)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement