Module 1 challenge: Scale and convert images using PIL :Automating Real-World Tasks with Python (Google IT Automation with Python Professional Certificate) Answers 2025
1. Access images inside a ZIP file
❌ Open directly in image viewer
❌ Rename to .jpg
✔️ Unzip using unzip images.zip
❌ Delete and download individually
2. Python library for image manipulation
❌ Fresco
✔️ Pillow (Python Imaging Library)
❌ Stencil
❌ Canvas
3. Run Python script from command line
✔️ chmod +x <script_name>.py to make executable
❌ Save as .pyexe
❌ Open in text editor only
❌ Copy-paste into terminal
4. Show names of resized images in /opt/icons
❌ Look visually in file manager
✔️ ls /opt/icons
❌ Open script to check naming logic
❌ Script automatically displays filenames
5. Confirm image dimensions in Python
✔️ Use img.size attribute
❌ Cannot determine without opening
❌ Open in photo editor
❌ Print file bytes with os.path.getsize()
6. Python script to check online image dimensions
❌ Cannot analyze without opening
❌ Use online website
✔️ Python script: from PIL import Image; with Image.open("image.jpg") as img: print(img.format, img.size)
❌ Check properties in file explorer
7. Efficiently access weather data for app
✔️ Use library/API for weather service
❌ Purchase data from stations
❌ Hire meteorologist
❌ Web scraping
8. Benefit of distributed computing for traffic spikes
❌ All requests to single server → bottleneck
❌ Security is major concern
✔️ Scale resources up/down depending on traffic
❌ Too complex for simple apps
9. Handle surge in e-commerce traffic
❌ Hire more customer service
❌ Reduce functionality
❌ Upgrade single server
✔️ Implement distributed system for scalability
10. Clean up unused Docker images
❌ docker ps and manually remove
❌ Ignore unused images
❌ Write custom script
✔️ docker image prune
📌 Summary Table
| Q# | Correct Answer(s) |
|---|---|
| 1 | Unzip images.zip ✔️ |
| 2 | Pillow ✔️ |
| 3 | chmod +x script ✔️ |
| 4 | ls /opt/icons ✔️ |
| 5 | img.size ✔️ |
| 6 | Python PIL script ✔️ |
| 7 | API/library for weather ✔️ |
| 8 | Scale resources dynamically ✔️ |
| 9 | Distributed system architecture ✔️ |
| 10 | docker image prune ✔️ |