def divide(x):
y = 10
c =0
sign=0
if(x<0):
x=-(x)
sign^=1
if(y<0):
y=-(y)
sign^=1
if(y!=0):
while(x>=y):
x=(x - y)
c +=1
if(sign):
c=(c)
return c
print divide(1500)
def davasaan(x):
global y
y = list(divmod(x,10))
return y[0]
Both works but not accepted in this task -.-
Created at: 2015/12/23 10:02; Updated at: 2016/02/17 21:55