You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c3f369c
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: Students/SSchwafel/Notes/10072014.notes
+60Lines changed: 60 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -328,4 +328,64 @@ In Python, the boolean types are subclasses of integer:
328
328
329
329
330
330
331
+
Whitespace is great because it encourages good formatting
332
+
333
+
All statements must be correspondingly indented
334
+
335
+
336
+
Other than indenting, space doesn't matter!
337
+
338
+
Read PEP 8 (Python Style guide) and install a linter in your editor <----
339
+
340
+
python is all about namespaces -- the "dots"
341
+
342
+
name.another_name
343
+
344
+
The dot indicates that you're looking for a name in the namespace of the given object
345
+
346
+
Namespace is collection of symbols that are bound to values
347
+
348
+
You can think of the files that you write that end in .py is a module
349
+
350
+
A MODULE is simply a namespace
351
+
352
+
A package is a module with other modules inside it
353
+
354
+
on a filesystem, this is represented as a directory that contains one or more .py files, one of which must be called __init__.py <---TURNS DIRECTORY FULL OF FILES INTO A PACKAGE
355
+
356
+
Then you can import from that directory into another program
357
+
358
+
359
+
When you import a module, or a symbol from a module, the Python code is compiled to bytecode, the result is a .pyc file
360
+
361
+
This executes ALL CODE AT THE MODULE SCOPE
362
+
363
+
For this reason, it is good to avoid module-scope statements that have global side-effect
364
+
365
+
366
+
The code in a module is NOT re-run when imported again, it must be explicitly reloaded with
367
+
368
+
import modulename
369
+
reload(modulename)
370
+
371
+
python - m <---if module is somewhere in Python Path (set of directories it looks in) it will be executed
372
+
373
+
You can also use the "run" command from within Ipython
374
+
375
+
========================================
376
+
377
+
378
+
Implement Ackermann function
379
+
380
+
create ack.py in session02
381
+
382
+
write a good docstring
383
+
384
+
Ackermann's function is not defined for input values less than 0, so check for that
385
+
386
+
Use an if __name__ == "__main__" to test your function
0 commit comments