Why is the program not printing three lines?

Chris Angelico rosuav at gmail.com
Thu Mar 19 10:26:42 EDT 2020


On Fri, Mar 20, 2020 at 1:04 AM Souvik Dutta <souvik.viksou at gmail.com> wrote:
>
> I should have been more clear
> class first():
>     print("from first")
>     def second():
>         print("from second")
> first()
>
> When I run the above code the output is
> "from first"
> (2ND CODE)
>

Try this *without* the call to first() in it. See how that changes
your expectations.

ChrisA


More information about the Python-list mailing list