# Пример вставки кода на python ~~~python class vec: MAX=100 MIN=0 @classmethod def validate(cls,arg): return cls.MIN <= arg < cls.MAX def __init__(self,x,y): self.x=self.y=0 if self.validate(x) and self.validate(y): self.x=x self.y=y @staticmethod def norm(x,y): return x*x+y*y def get_coords(self): return(self.x,self.y) print(vec.validate(5)) print (vec.norm(2,5)) ~~~
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up