functions & modules - cornell university
TRANSCRIPT
Functions & Modules
Presentation 3
Announcements
Reminders Keeping Up With Videos
9/10/20 Functions & Modules 2
• Have graded AI quiz§ Take now if have not§ If made 9/10, are okay§ Else must retake
• Survey 0 is still open§ For participation score§ Must complete them
• Must access in CMS
• Today § Lesson 3: Function Calls§ Lesson 4: Modules§ Videos 4.1-4.5
• Next Time§ Video 4.6 of Lesson 4§ Lesson 5: Function Defs
• Also skim Python API
9/10/20 Functions & Modules 3
Questions?
Reading Documentation
9/10/20 Functions & Modules 4
Reading isclose
• Assume that we type>>> import weird>>> isclose(2.000005,2.0)
• What is the result (value)?
9/10/20 Functions & Modules 5
A: TrueB: FalseC: An error!D: Nothing!E: I do not know
Reading isclose
• Assume that we type>>> import weird>>> isclose(2.000005,2.0)
• What is the result (value)?
9/10/20 Functions & Modules 6
A: TrueB: FalseC: An error!D: Nothing!E: I do not know
CORRECT
Reading isclose
• Assume that we type>>> import weird>>> weird.isclose(2.000005,2.0)
• What is the result (value)?
9/10/20 Functions & Modules 7
A: TrueB: FalseC: An error!D: Nothing!E: I do not know
Reading isclose
• Assume that we type>>> import weird>>> weird.isclose(2.000005,2.0)
• What is the result (value)?
9/10/20 Functions & Modules 8
A: TrueB: FalseC: An error!D: Nothing!E: I do not know
CORRECT
Reading isclose
• Assume that we type>>> import weird>>> weird.isclose(2.0,3.0,4.0)
• What is the result (value)?
9/10/20 Functions & Modules 9
A: TrueB: FalseC: An error!D: Nothing!E: I do not know
Reading isclose
• Assume that we type>>> import weird>>> weird.isclose(2.0,3.0,4.0)
• What is the result (value)?
9/10/20 Functions & Modules 10
A: TrueB: FalseC: An error!D: Nothing!E: I do not know
CORRECT
9/10/20 Functions & Modules 11
Reading Documentation
Reading isclose
• Assume that we type>>> import weird>>> weird.skipto(3.5)
• What is the result (value)?
9/10/20 Functions & Modules 12
A: 2B: 3C: 4D: An error!E: I do not know
Reading isclose
• Assume that we type>>> import weird>>> weird.skipto(3.5)
• What is the result (value)?
9/10/20 Functions & Modules 13
A: 2B: 3C: 4D: An error!E: I do not know
CORRECT
Reading skipto
• Assume that we type>>> from weird import *>>> skipto(3.5)
• What is the result (value)?
9/10/20 Functions & Modules 14
A: 2B: 3C: 4D: An error!E: I do not know
Reading isclose
• Assume that we type>>> from weird import *>>> skipto(3.5)
• What is the result (value)?
9/10/20 Functions & Modules 15
A: 2B: 3C: 4D: An error!E: I do not know
CORRECT
Reading isclose
• Assume that we type>>> import weird>>> weird.skipto(3.5,6)
• What is the result (value)?
9/10/20 Functions & Modules 16
A: 6B: 5C: 4D: An error!E: I do not know
Reading isclose
• Assume that we type>>> import weird>>> weird.skipto(3.5,6)
• What is the result (value)?
9/10/20 Functions & Modules 17
A: 6B: 5C: 4D: An error!E: I do not know
CORRECT
Reading isclose
• Assume that we type>>> import weird>>> weird.skipto(3.5,2,1)
• What is the result (value)?
9/10/20 Functions & Modules 18
A: 6B: 5C: 4D: An error!E: I do not know
Reading isclose
• Assume that we type>>> import weird>>> weird.skipto(3.5,2,1)
• What is the result (value)?
9/10/20 Functions & Modules 19
A: 6B: 5C: 4D: An error!E: I do not know
CORRECT