← Go Back

How to Count Number of Characters in a String

Using the len() built-in function:

greeting = "Hello, world!"
chars = len(greeting)
print(chars) # Prints 13


strings


🐍 You might also find interesting: