To check the size of a string in Python, you can use the built-in len()
function. The len()
function returns the number of characters in a string. Here's an example:
main.py63 chars3 lines
In this example, len()
returns the length of the string my_string
, which is 13
.
gistlibby LogSnag