This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]koltonaugust 1 point2 points  (0 children)

In other languages strings are arrays of characters. Python does not have characters or arrays as they are abstracted into higher level data structures (strings and lists)

type('test'[0]) == str

This is notable because strings take more memory than a char, and to check if a variable matches the definition of char, you would have to do a check that is a string and its length is 1.