https://github.com/python-ninja-hebi/training
https://github.com/python-ninja-hebi/training
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/python-ninja-hebi/training
- Owner: Python-Ninja-Hebi
- Created: 2020-03-08T18:47:10.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-15T17:17:17.000Z (almost 6 years ago)
- Last Synced: 2025-01-14T10:33:36.975Z (about 1 year ago)
- Language: Jupyter Notebook
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Training with Python Ninja Hebi
Author hebi@python-ninja.com
>Even a python ninja has to find a solution to everyday tasks
>before the way is clear to the ultimate wisdom.
## Task 1 - Delete all files with extension '.doc' in a folder
There are different ways to reach the goal. But you can not do it with only one command.
```python
import os
folder = '/example_path/'
for file in os.listdir(folder):
if file.endswith('.doc'):
os.remove(folder + file)
```
```python
```