Skip to content

Instantly share code, notes, and snippets.

View rahulkp220's full-sized avatar
🎯
Focusing

Rahul rahulkp220

🎯
Focusing
View GitHub Profile
from json import loads,dumps
def Unicodify(func):
“””
Checkes in the incoming data-types and returns unicode values
Intended only for strings and JSON Objects
“””
def wrapper(obj):
if isinstance(obj, str):
return loads(obj)
elif isinstance(obj, dict):
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)