0% found this document useful (0 votes)
2 views

Python Media Automation Quiz

The document is a quiz on Python for media automation, consisting of multiple choice, true/false, and short answer questions. It covers topics such as media task automation benefits, string formatting, image processing libraries, and functions related to file handling and hashtag generation. An answer key is provided for each section, detailing the correct responses.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Python Media Automation Quiz

The document is a quiz on Python for media automation, consisting of multiple choice, true/false, and short answer questions. It covers topics such as media task automation benefits, string formatting, image processing libraries, and functions related to file handling and hashtag generation. An answer key is provided for each section, detailing the correct responses.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Python for Media Automation Quiz Dr.

Morhaf

Part A: Multiple Choice (Choose the best answer) 00201149901175


1. 1. What is a key benefit of automating media tasks using Python?

• a) Increases human effort


• b) Reduces creativity
• c) Reduces human error
• d) Slows down media production

2. 2. In the `personalized_greeting` function, what does the `f` before the string indicate?

• a) Function string
• b) Fixed format
• c) Formatted string (f-string)
• d) File reference

3. 3. What issue does the basic `format_title` function fail to address? 00201149901175

• a) Removing trailing punctuation


• b) Maintaining uppercase acronyms and lowercase stopwords
• c) Removing newline characters
• d) Stripping numbers

4. 4. Which Python library is used to add a watermark to images? 00201149901175

• a) NumPy
• b) Pandas
• c) Pillow (PIL)
• d) OpenCV

5. 5. What does `os.listdir(directory)` do in the context of file renaming?

• a) Deletes all files in a directory


• b) Returns a list of all files in the directory
• c) Uploads files to a server
• d) Moves files to a new folder

Part B: True or False Dr. Morhaf 00201149901175


6. 6. The `generate_hashtags` function can accidentally include punctuation in the
hashtags.
7. 7. The enhanced title formatting function uses lists of stopwords and acronyms.
8. 8. The `create_email` function uses triple quotes to define a multi-line string.
9. 9. You must install the `os` library before using it in a script.
10. 10. The `rename_files` function works only on `.jpg` files.

Part C: Short Answer Dr. Morhaf 00201149901175


11. 11. Describe how the enhanced `get_hashtags` function improves hashtag generation.
12. 12. What would be the output of this code?

```python
print(format_title(" the rise of AI in MEDIA! "))
```
13. 13. Name two reasons why image watermarking is useful for media professionals.
14. 14. Explain how `enumerate()` is used in the `rename_files` function.
15. 15. What should a user ensure before calling `add_watermark("photo.jpg", "Media
Inc.")`?
Answer Key

Part A: Multiple Choice Dr. Morhaf 00201149901175


1. c

2. c

3. b

4. c

5. b

Part B: True or False


6. True

7. True

8. True

9. False

10. False

Part C: Short Answer


11. Removes punctuation, filters out ignore words, adds hashtags to meaningful words only.

12. Output: The Rise Of Ai In Media!

13. Branding and copyright protection.

14. It provides a count (index) used to create unique filenames.

15. The image file must exist in the working directory.

You might also like