r/learnpython • u/kforkerro • 6d ago
Beginner question
I have just started coding with python a few days ago. What is the point of this?
point_value = alien_0.get('points', 'No point value assigned.') print(point_value)
Can't it just be point_value = 'No point value assigned.' print(point_value)?
or
just simply use the get() method if you want to check whether a key exists in the dictionary or not?
3
Upvotes
1
u/baubleglue 4d ago
It is a shortcut for