Write a python function that Print all the Numbers Present in the Text File


Topic: Write a python function that Print all the Numbers Present in the Text File

Solution

def print_number(fname):
    with open(fname, 'r') as f:
        for line in f:
            words = line.split()
            for i in words:
                for letter in i:
                    if(letter.isdigit()):
                        print(letter)



List all Python Programs