Use len() to get the length of the invitations set.
len()
invitations
Make sure to type len(invitations).
len(invitations)