mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-13 22:00:19 -04:00
fix(curriculum): fixed typo in class and object lecture (#63585)
This commit is contained in:
@@ -71,7 +71,7 @@ attr_name = input('Enter the attribute you want to see: ')
|
||||
print(getattr(person, attr_name, 'Attribute not found'))
|
||||
```
|
||||
|
||||
In this case, if the user types in `name`, they see `John Doe`, and if they type in `age`, they see `30`. And If they type something that doesn't exist in the class like `email`, they see `Attribute not found`.
|
||||
In this case, if the user types in `name`, they see `John Doe`, and if they type in `age`, they see `30`. And if they type something that doesn't exist in the class like `email`, they see `Attribute not found`.
|
||||
|
||||
This is exactly where dynamic attribute handling shines. It lets your code respond to input and data it hasn't seen before.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user