Answers for "python count lines in string"

0

python count lines in string

txt = 'line1nline2nline3n'  # Three newline characters
print(txt.count('n'))         # prints: 3
Posted by: Guest on February-01-2022

Python Answers by Framework

Browse Popular Code Answers by Language