# Python Program to Count the Number of Lines in a Text File fname = input("Enter file name: ")num_lines = 0with open(fname, 'r') as f:    for line in f:        num_lines += 1print("Number of lines:")print(num_lines)