seatList1 = {'seat1': 1, 'seat2': 2, 'seat3': 3, 'seat4': 4, 'seat5': 5, 'seat6': 6, 'seat7': 7, 'seat8': 8, 'seat9': 9, 'seat10': 10 }
We were asking to make a ticket selling system, there are ten seats in total. I am planning to check they are ordered or not by data types. Once user typed their details in and choose an empty seat, the value of seat they choose will become to their first name. So that, to check a seat is ordered or not, the only thing I need to do is check those value of keys are integer or string
For example: user typed his details first, and then choose seat1, after that the value of 'seat1' key will be his name, instead of
'seat1': 1
But
'seat1': 'Tom'
If the value is a String instead of a number, there's no doubt that this seat has been ordered. But I don't know how to do that. I can use "if" to solve this problem, but that is too inefficient. Is there a better way to solve it? Thank you very much!