EGR 103/Concept List/F21

From PrattWiki
Revision as of 16:32, 27 August 2021 by DukeEgr93 (talk | contribs) (Lecture 1)
Jump to navigation Jump to search

Lecture 1

  • Main class page: EGR 103L.
  • See information on PDF of slide show on Errata / Notes page.
  • Sakai page: Sakai 103L page; grades, surveys and tests, some assignment submissions
  • Pundit page: EGR 103; reference lists
  • CampusWire page: CampusWire 103L page; message board for questions - you need to be in the class and have the access code 8018 to subscribe.

Lecture 2 - Programs and Programming

  • Almost all languages have input, output, math, conditional execution (decisions), and repetition (loops)
  • Seven steps of programming The Seven Steps Poster
  • Consider how to decide if a number is a prime number
  • To play with Python:
    • Install it on your machine or a public machine: Download
  • Quick tour of Python
    • Editing window, variable explorer, and console
    • Main numerical types: whole numbers (int) and numbers with decimals (float)
    • + - * // (rounded division) and % (remainder / modula) produce in if both sides are an int, float if either or both are floats
    • / (regular division) and // (rounded division) produces float with ints or floats
    • ** to do powers
    • Python doesn't know everything to start with; may need to import things
      • import MODULE means using MODULE.function() to run
      • import MODULE as NAME means using NAME.function() to run
    • VAR = input("prompt: ") will ask the user for a value and stores whatever they type as a string
    • NUM = int(VAR) will convert the item in VAR to an integer if it looks like an integer; error otherwise