On Oct 27, 2017 5:38 PM, "Ian Kelly" wrote:
In addition to what others have answered, if the code in question has any
variables then I'll prefer to put it inside a function and call the
function. This ensures that the variables are local and not going. It's a
minor code hygiene point, but a good
In addition to what others have answered, if the code in question has any
variables then I'll prefer to put it inside a function and call the
function. This ensures that the variables are local and not going. It's a
minor code hygiene point, but a good practice in my opinion.
--
https://mail.pytho
On 10/27/17 2:05 PM, ROGER GRAYDON CHRISTMAN wrote:
While teaching my introductory course in Python, I occasionally see
submissions containing the following two program lines, even before
I teach about functions and modules:
if __name__ = '__main__':
... main()
When I ask about it, I hear thin
On 2017-10-27, Chris Angelico wrote:
> On Sat, Oct 28, 2017 at 5:05 AM, ROGER GRAYDON CHRISTMAN wrote:
>> While teaching my introductory course in Python, I occasionally see
>> submissions containing the following two program lines,[...]
>> if __name__ = '__main__':
>> ... main()
> If it's JUS
On 27/10/17 20:05, ROGER GRAYDON CHRISTMAN wrote:
> While teaching my introductory course in Python, I occasionally see
> submissions containing the following two program lines, even before
> I teach about functions and modules:
>
> if __name__ = '__main__':
> ... main()
>
> When I ask about it,
On Sat, Oct 28, 2017 at 5:23 AM, Chris Angelico wrote:
> On Sat, Oct 28, 2017 at 5:05 AM, ROGER GRAYDON CHRISTMAN wrote:
>> While teaching my introductory course in Python, I occasionally see
>> submissions containing the following two program lines, even before
>> I teach about functions and mod
On Sat, Oct 28, 2017 at 5:05 AM, ROGER GRAYDON CHRISTMAN wrote:
> While teaching my introductory course in Python, I occasionally see
> submissions containing the following two program lines, even before
> I teach about functions and modules:
>
> if __name__ = '__main__':
> ... main()
>
> When I