#!/usr/bin/env python3

import os
import sys

class App:

    def __init__(self, args):
        self.ext = args[1]


    def get_ext(self, ext):
        array = ext.split('.')
        length = len(array)
        return array[length-1]

    def main(self):
        fnames = os.listdir()
        totalfiles = 0
        removedfiles = 0
        for file in fnames:
            totalfiles += 1
            if self.ext == self.get_ext(file):
                os.remove(file)
                removedfiles += 1
                print('Removed file : %s' % file)

        print('Total Files (%s): Removed(%s)' % (totalfiles, removedfiles))


def main():
    args = sys.argv
    s = App(args)
    s.main()


if __name__ == '__main__':
    main()