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