Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tickets_count = int(input())
- for ticket in range(tickets_count):
- ticket_number = input()
- ticket_number_len = len(ticket_number)
- seat = ""
- if ticket_number_len == 4:
- first_char_ascii =ord(ticket_number[0])
- if first_char_ascii > 65 and first_char_ascii <= 90:
- seat += ticket_number[0]
- seat += ticket_number[1]
- seat += ticket_number[2]
- else:
- seat += ticket_number[3]
- seat += ticket_number[1]
- seat += ticket_number[2]
- elif ticket_number_len == 5 or ticket_number_len == 6:
- seat += ticket_number[0]
- second_char_ascii = ord(ticket_number[1])
- seat += str(second_char_ascii)
- print(f"Seat decoded: {seat}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement