String Length in Python
The number of characters in a string (its length) can be found using the len function:
print(len('abc')) # 3
The string can also be stored in a variable:
txt = 'abc'
print(len(txt))
Space is also a symbol:
txt = 'ab c'
print(len(txt)) # 4
Given a string:
txt = 'abcdef'
Print the length of this string to the console.
Given a string:
txt = 'ab cd ef'
Print the length of this string to the console.