Not getting output

Michael Torrie torriem at gmail.com
Tue Oct 11 14:33:07 EDT 2016


On 10/11/2016 11:57 AM, dhawanpawan32 at gmail.com wrote:
> def abc(a,b):
>     l=[]
>     for i in range(a,b+1):
>         if i%2!=0:
>             
>             l.append(i)
>     print l    
>     return 1
> 
> def bg():
>     y=abc(11,31)
>     print y
> I am not getting the output, but if i call method abc outside the function then it's coming

Is this your entire program?  Because all I see are two function
definitions.  You have no code that actually calls either of these two
functions from the main level of your code.  Remember that Python
executes scripts in a procedural manner.




More information about the Python-list mailing list