Skip to content

Commit c3f369c

Browse files
committed
updating notes, some test scripts
1 parent 981793b commit c3f369c

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

‎Students/SSchwafel/Notes/10072014.notes‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,4 +328,64 @@ In Python, the boolean types are subclasses of integer:
328328

329329

330330

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
387+
388+
389+
Create a Fibonacci script
331390

391+
Check class site for homework :(

‎Students/SSchwafel/session01/google_DAT.py‎

100644100755
File mode changed.

0 commit comments

Comments
 (0)