* Lovelace
V Questions
V Python vs Python 3
* Python was originally released in 1991
* Python 2 made major improvements, released in 2000
* Python 3 fixed several fundamental design flaws, not compatible with Python 2, released in 2008
* Python 2 support ends in 2020
V Alternative textbooks
V if you want to purchase a more thorough reference text, there are two options I would recommend:
* Python Programming: An Introduction to Computer Science by John Zelle (3rd edition), emphasizes graphics, used by other CS 111 sections
* Practical Programming: An Introduction to Computer Science Using Python 3.6 by Paul Gries, Jennifer Campbell, and Jason Montojo, very well organized and clearly written
V Syllabus
V calendar
* will now show the correct times on import
* lecture topics more uncertain the farther out you get
V grade breakdown
V homework 0.5
* 4 individual, 4 pair (assigned)
* each homework will have a section of forums for posting questions
* feedback file
V quizzes 0.2
* 5 quizzes, on the Fridays of weeks 2, 4, 6, 8, 10
* About 25 minutes each
V final project 0.25
* project of your choice, solo or in a group of 2 (not assigned)
* more detail to come, project proposal due Nov. 1
V community 0.05
V broader than participation, basically anything that contributes to the success of the course
* asking questions in class, actively participating in in-class activities, being a good partner on pair assignments, contributing to discussions and answering questions on the course forums, helping your classmates when they get stuck on an assignment, crediting those who help you, and helping to build an inclusive learning environment
* including catching my inevitable mistakes—thanks Eloïse!
V inclusivity
* please treat your classmates with kindness and respect, both inside the classroom and out. Classrooms can be vulnerable environments; asking questions and expanding our understanding of new concepts requires us to reveal over and over again that we don't fully know something. It's okay to not know everything immediately! It's not okay to make people feel bad about what they don't know. Our individual differences enrich and enhance our understanding of one another and of the world around us. This class welcomes the perspectives of all ethnicities, genders, religions, ages, sexual orientations, disabilities, socioeconomic backgrounds, regions, and nationalities.
V late days
* 4 late days, used in 24-hour chunks, email me before the homework is due, both partners must have available late days to use them
V collaboration
* You should never be in possession of a (paper or electronic) copy of a classmate’s code before the due date for the assignment
* when getting help, that consultation should be in English and not in Python
* Need to be able to explain anything you submit, give credit where credit is due
V anonymous feedback
* Linked from web page and Moodle
* really really helpful for me!
V visiting hours
* visit me in my office (CMC 135) after class on Mondays (3-4) and Thursday afternoons (1-2)
* come with questions about anything or just to chat!
* email to set up another time
* I’ll visit the lab (CMC 102) Wednesdays 8-9
V Refresh: notional machine
* http://cs.carleton.edu/faculty/awb/cs111/f19/notional_machine.md.html
V Problem: what icon to display in weather app?
* Computer needs to make a decision at a particular point in time
V Preparation for future learning
* diagram what computer needs to know (input) and what the possible outcomes could be (output)
* sketch the operations computer must do and their ordering
V Simplified problem: difference between current and “hot” temperature (i.e., should the app show the current temperature in red)
* outline: get input data, calculate difference, output result
V have the values we want: get_cur_temp() and 80 F
V don’t worry about exactly what’s going on with get_cur_temp()
* we’ll get into it next week, for now, abstraction!
V need to make these values available and give them useful names—assignment!
V variables
* = and variables have different meaning than in math
V assignment statement: <variable name> = <expression>
* cur_temp = get_cur_temp()
* hot_temp = 80
* assignment copies value to memory and gives it a label (the variable name)
V variable names follow certain rules
* must begin with a letter or an underscore, can only contain letters, number, and underscores
* no spaces
* case sensitive (e.g., cur_temp and Cur_temp are different names)
V to make variable names easier to read, convention is to use underscores or capitalization
* cur_temp or curTemp
* the latter is called camel case
V just got off the phone with Current Temperature Inc., get_cur_temp() is in C
V arithematic
V Python provides the standard mathematical operators
* + (addition)
* - (subtraction)
* * (multiplication)
* / (division)
* % (remainder or modulo)
* ** (exponent)
* Follows the order of operations you learned in math class, use parentheses to control order
* C = (F - 32) * 5 / 9
V cur_temp_F = (cur_temp - 32) * 5 / 9
* when a variable appears on the right side of an =, it is interpreted as the value it labels in memory
* when a variable appears on the left side of an =, it is the label where the value computed on the right side will be stored
* quick check: write Python code to compute a lower bound on time I spent watching Fellowship of the Ring (2 hours 58 minutes) when it came out on VHS (I watched it every day for a week), the final result should be assigned to a variable
V calculate difference
* difference = hot_temp - cur_temp_F