Posts

Leap year checker by Rahul

  def  is_leap(year):      if  year %  4  ==  0   and  year %  100  !=  0   and  year %  400  ==  0 :         leap =  True          return  leap      elif  year %  4   and  year %  400 ==  0 :             leap=  True              return  leap      elif  year %  4  == 0   and  year %  100  != 0 :         leap=  True          return  leap      elif  year %  400  == 0 :       ...

Function to get a no. before input no.

 a= int(input(" Put your no.\n")) d= int(0) c=[] Letst= True while Letst:     for n in range(0, a):         d+= a -(a-1)          c.append(d)         if d-a== 0:             Letst = False              def convert(c):            s = [str(i) for i in c]            res = int("".join(s))            return(res)