Question 10/13 fast.ai v3 lecture 9
We have an object called
something. If the object has an attribute
val, we would like to access it. If it doesn't, we would like to return a default value of
How do we achieve this?
getattr(something, 'val', False)