Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

why type(t) is Nonetype?????

0 votes
asked Jun 24, 2019 by 오찬솔 (130 points)
def ley(x,y,gg=1):
    print(gg)
    if(gg%x==0)&(gg%y==0):
        print(type(gg))
        return gg
    else:
        gg+=1
        ley(x,y,gg)
t=ley(2,3,1)
print(type(t))

2 Answers

0 votes
answered Jun 28, 2019 by krishna singh
Bcoz your function is non returning type hence its type(t) is none simply t=ley(2,3,1) will be treated as simply ley(2,3,1) and also function is of NoneType
+1 vote
answered Jun 29, 2019 by Big Al
Your popping out of your function in the "else" condition.  Since you're not returning a value there you are getting the NoneType response.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...