# TypeError: 'int' object does not support item assignment , Using array

I'm trying to get this program to work by having an array for the Ticket_Seat which is the train choice by having [0] as outbound and [1] as return but i keep getting this error , int object does not support item assignment when i run it though terminal.

I have added the code but it is evident that the program is not too efficient , keep in mind that i have only started coding and i am a student completing a case study about a train

```
def Input():
Ticket_Seat[0] = int(input("Choose your train -> "))
Ticket_Seat[0] = Ticket_Seat - 1
while Ticket_Seat[0] == -1 or Ticket_Seat[0] > 6 :
print("Enter a valid train ")
Ticket_Seat[0] = int(input("Choose your train -> "))
Ticket_Input = int(input("Enter number of seats -> "))
while Ticket_Input == -1 :
print("Enter a valid Number ")
Ticket_Input = int(input("Enter number of seats -> "))
difference_Seat_Validation = Train[Ticket_Seat[0]] - Ticket_Input
while difference_Seat_Validation < 0:
print("1. Choose another train \n 2. Choose less seats")
choice_Seat_Validation = int(input("Enter your choice -> "))
if choice_Seat_Validation == 1:
Ticket_Seat[0] = int(input("Choose your train -> "))
while Ticket_Seat[0] == -1 or Ticket_Seat[0] > 6 :
print("Enter a valid train ")
Ticket_Seat[0] = int(input("Choose your train -> "))
Ticket_Input = int(input("Enter number of seats -> "))
while Ticket_Input == -1 :
print("Enter a valid Number ")
Ticket_Input = int(input("Enter number of seats -> "))
elif choice_Seat_Validation == 2:
Ticket_Input = int(input("Enter number of seats -> "))
while Ticket_Input == -1 :
print("Enter a valid Number ")
Ticket_Input = int(input("Enter number of seats -> "))
difference_Seat_Validation = Train[Ticket_Seat[0]] - Ticket_Input
Pay_Ticket_Price = Ticket_Input * 25
Pay_Ticket_10 = Ticket_Input // 10
Pay_Ticket_Price = Pay_Ticket_Price - (25 * Pay_Ticket_10)
print("You pay for leaving ticket and return ticket")
print("Total compelled to pay -> " , Pay_Ticket_Price)
PayValidation = int(input("Once payed please press 1 -> "))
while PayValidation != 1 :
print("Please Press a valid number , 1 , ")
PayValidation = int(input("Once payed please press 1 -> "))
if PayValidation == 1:
print("\n"*40)
print("Enjoy your train")
if Ticket_Seat[0] == 0:
Train[0] = Train[0] - Ticket_Input
if Ticket_Seat[0] == 2:
Train[2] = Train[2] - Ticket_Input
if Ticket_Seat[0] == 4:
Train[4] = Train[4] - Ticket_Input
if Ticket_Seat[0] == 6:
Train[6] = Train[6] - Ticket_Input
Ticket_Seat[1] = int(input("Choose your return train -> "))
Ticket_Seat[1] = Ticket_Seat[1] - 1
while Ticket_Seat == -1 :
print("Enter a valid Number ")
Ticket_Input = int(input("Choose a valid return train -> "))
while Ticket_Seat[1] == 0:
print("Enter a valid Number ")
Ticket_Seat[1] = int(input("Choose a valid return train -> "))
while Ticket_Seat == 2:
print("Enter a valid Number ")
Ticket_Input = int(input("Choose a valid return train -> "))
while Ticket_Seat[1] == 5:
print("Enter a valid Number ")
Ticket_Input = int(input("Choose a valid return train -> "))
print(Ticket_Seat[1] , Ticket_Input)
if Ticket_Seat[1] == 1:
Train[1] = Train[1] - Ticket_Input
if Ticket_Seat[1] == 3:
Train[3] = Train[3] - Ticket_Input
if Ticket_Seat[1] == 5:
Train[5] = Train[5] - Ticket_Input
if Ticket_Seat[1] == 7:
Train[7] = Train[7] - Ticket_Input
```