Using Python built-in function ‘len()’, we can get the number of characters in a string.
no_of_chars_in_string.py
str = 'Hello World'
msg = f'"{str}" has {len(str)} characters'
print(msg)
Output
"Hello World" has 11 characters
This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here