Python Count Lignes en chaîne
txt = 'line1\nline2\nline3\n' # Three newline characters
print(txt.count('\n')) # prints: 3
Yaakov Belch
txt = 'line1\nline2\nline3\n' # Three newline characters
print(txt.count('\n')) # prints: 3