Module 5 challenge: Final Project :Crash Course on Python (Google IT Automation with Python Professional Certificate) Answers 2025
1. Why is understanding the problem essential?
✔️ To identify the inputs and outputs of the problem
✔️ To write code that will solve the problem in a clear and concise way
❌ To select which scripting language to use
✔️ Ensure that you are writing a script that is efficient and effective
2. Output of numbers.sort()
✔️ 1, 2, 3, 4, 5
❌ 3, 1, 5, 4, 2
❌ 1, 5, 2, 4, 3
❌ 3, 2, 5, 5, 1
3. Method to sort a list in place
✔️ The sort() method
❌ The sorted() method with a reverse argument
❌ The sorted() method
❌ The sort() method with a reverse argument
4. Argument to sort in descending order
✔️ reverse = True
❌ reverse = False
❌ backup = False
❌ backup = True
5. Purpose of key=len
✔️ To sort a list of strings based on their length
❌ To sort a list of strings based on importance
❌ To sort a list of strings based on their capitalization
❌ To sort a list of strings alphabetically
6. Statements true about Python dictionaries
✔️ Values in a dictionary can be Python objects
✔️ Dictionaries are mutable data structures
❌ They replaced sets in Python v.3+
✔️ Dictionaries are used to store data that needs to be accessed quickly and efficiently
7. Handling high-volume real-time data
✔️ Use a third-party library or tool designed for real-time data processing
❌ Create one function to process the events and print the associated data
❌ Create 2 separate functions to process the events and print the data
❌ Increase the size of the database server
8. What does the code snippet do?
✔️ It checks if the event type is “login” and if so, adds the user to the list of logged-in users for a specified machine
❌ It adds the user to the list of logged-in users for the specified machine
❌ It checks if the event type is “logout” and removes the user
❌ It removes the user from the list of logged-in users
9. Conditional statement for reward tiers
✔️ elif statement
❌ true statement
❌ and statement
❌ if statement
10. Parameters of the init method
✔️ event_date
✔️ event_type
✔️ machine_name
✔️ user
❌ event
📌 Summary Table
| Q# | Correct Answer(s) |
|---|---|
| 1 | Inputs/outputs, clear code, efficiency ✔️ |
| 2 | 1, 2, 3, 4, 5 ✔️ |
| 3 | sort() method ✔️ |
| 4 | reverse = True ✔️ |
| 5 | key=len → sort by string length ✔️ |
| 6 | Values objects, mutable, fast access ✔️ |
| 7 | Use third-party library/tool ✔️ |
| 8 | Adds user on login ✔️ |
| 9 | elif statement ✔️ |
| 10 | event_date, event_type, machine_name, user ✔️ |