Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Latest commit

 

History

History

core_lesson3

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Lesson 3 - Discovering you Paths

Ch2 Comparison Operators

  • Comparison operators
    • Greater than >
    • Less than <
    • Equal to ==
    • Not equal to !=
    • Greater or equal to >=
    • Less or equal to <=
  • Special cases
    • 1.1 + 2.2 != 3.3 (floating approximation values)
    • False < True (0 < 1)
    • "10" != 2 (can compare objects of different type, no error)
    • "B" < "b" (Capital < lowercase)

Ch3 If Statements

  • Compound statement
    • Multiple simple statements inside the statement
  • Indentation
    • 4 spaces or 1 tab
    • Don't mix them
  • Multi-way selection
    • if-elif-else statements

Ch6 Function Calls

  • Takes some input, produces an output
  • To use a function, we need to know
    • Name
    • What it does
    • Arguments (inputs)
    • Return (output)
  • Importing modules
    • Keyword import

Ch8 Composition and Abstraction

  • Composition
    • Using a block of code inside another block
    • To achieve a larger goal
  • Abstraction
    • Giving block names
    • Allow for reusable and self-explanatory code

Ch9 Incremental Development

  • Testing
    • Always test while developing
  • pass
    • Do nothing
    • Use when the inside bits aren't implemented yet
  • NO true random
    • Reproduce experiment results
      • Making random numbers repeatable with the same seed
    • Always use a seed number in AI/ML projects

Ch10 Commenting

  • Readability
    • Helps to understand the code
  • Commenting out codes
    • Temporarily remove code without deleting it
    • Should be removed when complete
  • Multi-line comments aren't actually comments
    • ''' is a string literal'''
  • Conventions
    • Useful / informative
    • Easy to understand
  • Docstrings
    • First line of comment is inline with starting """
    • Ending """ should be on a line on its own