csc 111 introduction to computer science - clark …€¦ · · 2015-01-30csc 111 introduction to...
TRANSCRIPT
![Page 1: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/1.jpg)
mith College
Computer Science
Dominique Thiébaut [email protected]
CSC 111 Introduction to
Computer ScienceDominique Thiebaut
Spring 2015
![Page 2: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/2.jpg)
D. Thiebaut, Computer Science, Smith College
Today:• Class Web Page: http://tinyurl.com/
1112015
• Syllabus
• Piazza
• Moodle
• Python & Idle
• Waiver forms & Registration
![Page 3: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/3.jpg)
D. Thiebaut, Computer Science, Smith College
Syllabus • http://tinyurl.com/1112015
• http://cs.smith.edu
• faculty
• D. Thiebaut
• more info
![Page 4: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/4.jpg)
D. Thiebaut, Computer Science, Smith College
Please answer the Survey!
![Page 5: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/5.jpg)
D. Thiebaut, Computer Science, Smith College
CSC111: Amount of Work
Semester
Leve
l of D
ifficu
lty
![Page 6: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/6.jpg)
D. Thiebaut, Computer Science, Smith College
CSC111: Amount of Work
Semester
Leve
l of D
ifficu
lty
Your level
![Page 7: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/7.jpg)
D. Thiebaut, Computer Science, Smith College
This week…
Semester
Leve
l of D
ifficu
lty
Your level
![Page 8: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/8.jpg)
D. Thiebaut, Computer Science, Smith College
Goals for this Week• Learn how to use Idle
• Write simple programs that use variables, for loops, and output information
• Install Python and Idle on laptop (optional)
• Learn how to submit Python programs to Moodle (lab+homework)
• Do Lab #1 and start on Homework #1
![Page 9: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/9.jpg)
D. Thiebaut, Computer Science, Smith College
Rule for Laptop Use in Class
• Laptops welcome for note-taking, accessing class Web page, and for running Python programs
• All other use is forbidden
![Page 10: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/10.jpg)
D. Thiebaut, Computer Science, Smith College
Reading
• Read Chapter 1 in John Zelle's Python Programming, up to Section 1.7 included
![Page 11: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/11.jpg)
D. Thiebaut, Computer Science, Smith College
What is a Programming
language?
![Page 12: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/12.jpg)
D. Thiebaut, Computer Science, Smith College
Important Concepts…• Syntax and keywords and del from not while as elif global or with assert else if pass yield break except import print class exec in raise continue finally is return def for lambda try
• Algorithm
• Python is an interpreted language
![Page 13: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/13.jpg)
D. Thiebaut, Computer Science, Smith College
Interpreted vs. Compiled
vs.
![Page 14: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/14.jpg)
D. Thiebaut, Computer Science, Smith College
An Example Program
![Page 15: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/15.jpg)
D. Thiebaut, Computer Science, Smith College
![Page 16: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/16.jpg)
D. Thiebaut, Computer Science, Smith College
COMMENT
DIFFERENT COLORS:SYNTAX HIGHLIGHTEING
INDENTATIONIS
IMPORTANT
SPECIAL TOOL:EDITOR
I D E
![Page 17: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/17.jpg)
D. Thiebaut, Computer Science, Smith College
Integrated Development = IDLE Environment
![Page 18: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/18.jpg)
D. Thiebaut, Computer Science, Smith College
Integrated Development Environment
Integrated Development = IDLE Environment
![Page 19: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/19.jpg)
D. Thiebaut, Computer Science, Smith College
Integrated Development Environment
(MAC)
Integrated Development = IDLE Environment
![Page 20: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/20.jpg)
D. Thiebaut, Computer Science, Smith College
Integrated Development Environment
(Windows)
Integrated Development = IDLE Environment
![Page 21: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/21.jpg)
D. Thiebaut, Computer Science, Smith College
Registering Wait-Listed Students
• If you are already registered, you can leave!
• Priority rule for wait-listed:
• Max number per lab section: 25 students
• 1) EGR majors (CSC111 required)
• 2) Follow natural order in wait-list
![Page 22: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/22.jpg)
D. Thiebaut, Computer Science, Smith College
We stopped here last time…
![Page 23: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/23.jpg)
D. Thiebaut, Computer Science, Smith College
Meet the CSC111 support staff:
Dave Marshall, Lab Instructor
Galen Long, Head TA
![Page 24: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/24.jpg)
D. Thiebaut, Computer Science, Smith College
Beginningof the
Semester…
![Page 25: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/25.jpg)
D. Thiebaut, Computer Science, Smith College
Brief Review
• Python
• Language
• Syntax
• Sequence, Instructions
![Page 26: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/26.jpg)
D. Thiebaut, Computer Science, Smith College
DEMO TIME!
![Page 27: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/27.jpg)
D. Thiebaut, Computer Science, Smith College
Concepts to Cover in Demo
• Console vs. Edit window
• Variables
• numbers: integers and floats
• text: strings of characters
• print function
![Page 28: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/28.jpg)
D. Thiebaut, Computer Science, Smith College
Demo Programs To Play With…
for name in [ "Lea Jones", "Julie Fleur", "Anu Vias" ]: print( name ) print( "———————" )
age = 20 year = 2015 yearBorn = year - age print( "you are", age ) print( "you were born in", yearBorn )
name = "Alex" college = "Smith College" print( name, "goes to", college )
![Page 29: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/29.jpg)
D. Thiebaut, Computer Science, Smith College
Demo Programs To Play With… (cont’d)
for name in [ "Lea Jones", "Julie Fleur", "Anu Vias" ]: print( name, len( name ) )
print( "hello" * 4 ) print( "-" * 10 ) greetings = “hello” dash = "-" print( greetings * 4 ) print( dash * 10 )
greetings = "hello" longGreetings = greeting * 4 print( greetings ) print( longGreetings )
![Page 30: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/30.jpg)
D. Thiebaut, Computer Science, Smith College
Demo Programs To Play With… (cont’d)
for name in [ "Lea Jones", "Julie Fleur", "Anu Vias" ]: bar = len( name ) * "-" print( name ) print( bar )
print( "hello" * 4 ) print( "-" * 10 )
greetings = “hello” dash = "-" print( greetings * 4 ) print( dash * 10 )
greetings = "hello" longGreetings = greeting * 4 print( greetings ) print( longGreetings )
![Page 31: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/31.jpg)
D. Thiebaut, Computer Science, Smith College
Registering Wait-Listed Students
• Status as of 1/28/15 (R=registered, NS=needs signature, WL=wait-listed)
• Lab 01: W 1-3: 21 R + 2 WL
• Lab 02: Th 1-3: 24 R + 1 WL (?)
• Lab 03: Th 3-5: 24 R + 4 WL
• Lab 04: W 3-5: 16 R + 0 WL
![Page 32: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/32.jpg)
D. Thiebaut, Computer Science, Smith College
We stopped here last time…
![Page 33: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/33.jpg)
D. Thiebaut, Computer Science, Smith College
Registration Update
• Should be able to absorb wait-listed students
• No section transfer between Labs 1, 2, or 3, unless you find somebody to transfer the other way
• Many seats left in Section 4 (Wed 3-5)
![Page 34: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/34.jpg)
D. Thiebaut, Computer Science, Smith College
Plan Review of the lab
Introduction to Homework #1
def block
Demo
Something fun…
![Page 35: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/35.jpg)
D. Thiebaut, Computer Science, Smith College
Lab 1 Q&A
![Page 36: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/36.jpg)
D. Thiebaut, Computer Science, Smith College
Homework #1
# Homework 1, Problem 3 (read Section 1.6 in Zelle)
def greet( person ): print( person ) print( "How are you?" )
greet( "John" )greet( "Emily" )greet( "Lujun" )
![Page 37: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/37.jpg)
D. Thiebaut, Computer Science, Smith College
Something Fun…Facial recognition in movies…
NCIS New Orleans "One eye and a pimple" http://youtu.be/_epXpbICzeg
![Page 38: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/38.jpg)
D. Thiebaut, Computer Science, Smith College
Practice Python!
![Page 39: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/39.jpg)
D. Thiebaut, Computer Science, Smith College
Beginningof the
Semester
![Page 40: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/40.jpg)
D. Thiebaut, Computer Science, Smith College
AFTERONE SEMESTER
![Page 41: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/41.jpg)
D. Thiebaut, Computer Science, Smith College
Computer Science
Major
![Page 42: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/42.jpg)
D. Thiebaut, Computer Science, Smith College
Variables
age
![Page 43: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/43.jpg)
D. Thiebaut, Computer Science, Smith College
Variables
age age = 23
23
![Page 44: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/44.jpg)
D. Thiebaut, Computer Science, Smith College
Variables
23
age = 23age23
assignment
![Page 45: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/45.jpg)
D. Thiebaut, Computer Science, Smith College
Variables
name
“Smith”
name = “Smith”“Smith”
assignment
![Page 46: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/46.jpg)
D. Thiebaut, Computer Science, Smith College
Variables
rate
21.34
rate = 21.3421.34
assignment
![Page 47: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/47.jpg)
D. Thiebaut, Computer Science, Smith College
Variables & Expressions
age23
newValue10
age = 23 newValue = 10
![Page 48: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/48.jpg)
D. Thiebaut, Computer Science, Smith College
Variables & Expressions
age23
newValue10
age = 23 newValue = 10 age = newValue
![Page 49: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/49.jpg)
D. Thiebaut, Computer Science, Smith College
Variables & Expressions
age23 10
newValue10
age = 23 newValue = 10 age = newValue
![Page 50: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/50.jpg)
D. Thiebaut, Computer Science, Smith College
Variables & Expressions
age10
newValue10
age = 23 newValue = 10 age = newValue age = age + 2
![Page 51: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/51.jpg)
D. Thiebaut, Computer Science, Smith College
Variables & Expressions
age10
newValue10
age = 23 newValue = 10 age = newValue age = age + 2
10
![Page 52: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/52.jpg)
D. Thiebaut, Computer Science, Smith College
Variables & Expressions
age10
newValue10
age = 23 newValue = 10 age = newValue age = age + 2
10+2
![Page 53: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/53.jpg)
D. Thiebaut, Computer Science, Smith College
Variables & Expressions
age10
newValue10
age = 23 newValue = 10 age = newValue age = age + 2
10+2 = 12
![Page 54: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/54.jpg)
D. Thiebaut, Computer Science, Smith College
Variables & Expressions
age10 12
newValue10
age = 23 newValue = 10 age = newValue age = age + 2
10+2 = 12
![Page 55: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/55.jpg)
D. Thiebaut, Computer Science, Smith College
Exercisea = 10 b = 20 c = 30
a = b # a = ?
![Page 56: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/56.jpg)
D. Thiebaut, Computer Science, Smith College
Exercisea = 10 b = 20 c = 30
a = b # a = 20 b = a # a = ? b = ?
![Page 57: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/57.jpg)
D. Thiebaut, Computer Science, Smith College
Exercisea = 10 b = 20 c = 30
a = b # a = 20 b = a # a = 20 b = 20 c = c * 2 # c = ?
![Page 58: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/58.jpg)
D. Thiebaut, Computer Science, Smith College
Exercisea = 10 b = 20 c = 30
a = b # a = 20 b = a # a = 20 b = 20 c = c * 2 # c = 60 d = d - 10 # d = ?
![Page 59: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/59.jpg)
D. Thiebaut, Computer Science, Smith College
Exercisea = 10 b = 20 c = 30
a = b # a = 20 b = a # a = 20 b = 20 c = c * 2 # c = 60 d = d - 10 # NameError: # name 'd' is not defined
![Page 60: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/60.jpg)
D. Thiebaut, Computer Science, Smith College
Naming Variables
a age delta name1 name2 R2D2 aVeryLongName
1tooMany
![Page 61: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/61.jpg)
D. Thiebaut, Computer Science, Smith College
Naming Variables
a age delta name1 name2 R2D2 aVeryLongName
1tooMany
![Page 62: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/62.jpg)
D. Thiebaut, Computer Science, Smith College
Naming Variables
this_is_good_too but wePrefer thisIsGoodToo
lambda for
![Page 63: CSC 111 Introduction to Computer Science - Clark …€¦ · · 2015-01-30CSC 111 Introduction to Computer Science Dominique Thiebaut Spring 2015. ... 16 R + 0 WL . D. Thiebaut,](https://reader035.vdocuments.us/reader035/viewer/2022081323/5ae589057f8b9a8b2b8bfb1e/html5/thumbnails/63.jpg)
D. Thiebaut, Computer Science, Smith College
Registering Wait-Listed Students
• Status as of 1/28/15 (R=registered, NS=needs signature, WL=wait-listed)
• Lab 01: W 1-3: 22 R + 3 NS + 1 WL
• Lab 02: Th 1-3: 21 R + 3 NS + 3 WL
• Lab 03: Th 3-5: 21 R + 4 NS + 5 WL
• Lab 04: W 3-5: 11 R + 6 NS + 0 WL 8