In this we are going to see a basic example of Python Count Lines in a String in Python Programming Language.
def count_lines()_
str1 = """Help For Coders
Python is a programming language
Hello World"""
print(str1)
str1 = str1.split("\n")
print("------------------------------")
print("No. of Lines: ",len(str1))
count_lines()
# Coded By Dhiraj Shelke
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP