staticmetho python code example
Example: staticmethod python
import random
class Example:
# A static method doesn't take the self argument and
# cannot access class members.
@staticmethod
def choose(l: list) -> int:
return random.choice(l)
def __init__(self, l: list):
self.number = self.choose(l)