See your warning is just a IDE type warning
When you do inivitation_list =[ ..]
It work like list[str]
But when you do invitation_list[0] it think you are trying to do list[int][str] which is not allowed but the code is fine.
Your code is fine but if you want to remove such warnings then just do
Invitation_list : List[str] = [ "Allen", "Lucas",..]
By doing this your code should not show any warnings ☺️