Intern — Middle
How to correctly call a static method in Python
livecode
Task condition
In which case will the method execute without exceptions? The code needs to be corrected.
class Developer:
@staticmethod
def greet():
return "Hello World!"
# Both calls work correctly:
print(Developer.greet()) # call via class
print(Developer().greet()) # call via object