I have found that my snakes do recognize people. The ball pythons will stay balled up for a long time if a new person is holding them, or if one of the rougher kids is holding them. If it's someone they recognize, and remember them being gentle, they'll pop out very quickly. So they are capable of basic pattern recognition at least, and do "have friends". Although calling it affection is probably a little too far!They don't have the same range that we or other animals have. They are instinct only. Hot, cold, secure, danger, etc.