Created
April 22, 2016 14:37
-
-
Save rahulkp220/512583632fe8f28c2241c9f4688747fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
class A(object): | |
cursur = 0.0 | |
def __init__(self,x,y): | |
self.x = x | |
self.y = y | |
def move_forward(self,x,y): | |
x+=1 | |
y+=1 | |
A.cursur += math.sqrt(x**2 + y**2) | |
return “New location after moving forward is ({}, {})”.format(x,y) | |
@staticmethod | |
def cube(*args): | |
return “Cube is {}”.format(sum([i**2 for i in list(args)])) | |
@classmethod | |
def get_cursor_location(cls): | |
return “New cursor location is {}”.format(cls.cursur) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment