title: delete specific files with extention in bulk with user input
body: <p>I need to delete files with a specific extension but IT HAS TO TAKE THE USERS INPUT and the script I have does that but it does it one by one but not in bulk and I have honestly been very confused on how to complete this can I get some help on this please I have been struggling, the script below I appreciate all help:</p>
  <pre><code>for root, dirnames, filenames in os.walk('path'):
      for xml in filenames:
          if xml.lower().endswith('.xml'):
              if input('remove exisiting xml files? y/n: ') == &quot;y&quot;:
                  os.remove(os.path.join(root, XML))
                  print('the file has been deleted succesfully')
      else:
          print('the file has not been deleted')
  </code></pre>