This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Function to get names of users older than 18 | |
| def users_above_18(users): | |
| # Create an empty list to store names | |
| names = [] | |
| # Loop through each user dictionary in the list | |
| for u in users: | |
| # Check if the user's age is greater than 18 | |
| if u["age"] > 18: | |
| # Add the user's name to the list "names" |