variables in Py

new topic     » topic index » view thread      » older message » newer message

David Cuny,

  The py.txt says variables are created by assigning a value to it.
Is this good enough?
  Suppose I create a variable like so:

number = 0   -- The variable 'number' is created

   Then suppose in another place I want to re-initialize 'number', and I
make a typo:

numer = 0    -- Another variable is created, by a typo.

  In a normal language, this is caught instantly as "undeclared" and I can
fix it instantly.

  I used to program in GFA Basic. It did not have explicit declarations of
global variables, and consequently simple typos tended to cause major
trials and tribulations.


Jerry Story

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu