15-110: Principles of Computing Functions- Part I

15-110: Principles of Computing Functions- Part I
1 / 1
15-110: Principles of Computing Functions- Part I - slide 1 of 28 15-110: Principles of Computing Functions- Part I - slide 2 of 28 15-110: Principles of Computing Functions- Part I - slide 3 of 28 15-110: Principles of Computing Functions- Part I - slide 4 of 28 15-110: Principles of Computing Functions- Part I - slide 5 of 28 15-110: Principles of Computing Functions- Part I - slide 6 of 28 15-110: Principles of Computing Functions- Part I - slide 7 of 28 15-110: Principles of Computing Functions- Part I - slide 8 of 28 15-110: Principles of Computing Functions- Part I - slide 9 of 28 15-110: Principles of Computing Functions- Part I - slide 10 of 28 15-110: Principles of Computing Functions- Part I - slide 11 of 28 15-110: Principles of Computing Functions- Part I - slide 12 of 28 15-110: Principles of Computing Functions- Part I - slide 13 of 28 15-110: Principles of Computing Functions- Part I - slide 14 of 28 15-110: Principles of Computing Functions- Part I - slide 15 of 28 15-110: Principles of Computing Functions- Part I - slide 16 of 28 15-110: Principles of Computing Functions- Part I - slide 17 of 28 15-110: Principles of Computing Functions- Part I - slide 18 of 28 15-110: Principles of Computing Functions- Part I - slide 19 of 28 15-110: Principles of Computing Functions- Part I - slide 20 of 28 15-110: Principles of Computing Functions- Part I - slide 21 of 28 15-110: Principles of Computing Functions- Part I - slide 22 of 28 15-110: Principles of Computing Functions- Part I - slide 23 of 28 15-110: Principles of Computing Functions- Part I - slide 24 of 28 15-110: Principles of Computing Functions- Part I - slide 25 of 28 15-110: Principles of Computing Functions- Part I - slide 26 of 28 15-110: Principles of Computing Functions- Part I - slide 27 of 28 15-110: Principles of Computing Functions- Part I - slide 28 of 28
15-110: Principles of Computing Functions- Part I Lecture 3, September 09, 2018 Mohammad Hammoud Carnegie Mellon University in Qatar Today Last Session: Basic Elements of Python Programs Todays Session: Functions- Part I: Why using

Related Topics

Download this presentation From Below

"15-110: Principles of Computing Functions- Part I" is the property of its rightful owner. Permission is granted to download and print the materials on this website for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Presentation Transcript

01
15-110: Principles of Computing Functions- Part I
Lecture 3, September 09, 2018

Mohammad Hammoud
Carnegie Mellon University in Qatar<br>
02
Today… Last Session:
Basic Elements of Python Programs

Today’s Session:
Functions- Part I:
Why using functions?
Formal definition, parameters, local and global scopes of variables, return values, and pass-by-value

Announcement:
Homework Assignment (HA) 01 is out. It is due on Thursday, Sep 13, 2018 by 10:00AM<br>
03
So far, we have been using only one-line snippets in the interactive mode, but we may want to go beyond that and execute an entire sequence of statements

Python allows putting a sequence of statements together to create a brand-new command or function Multiple-line Snippets and Functions >>> def hello():
...     print("Hello")
...     print("Programming is fun!")
... 
>>> These indentations are necessary to indicate that these two statements belong to the same block of code, which belongs to this function<br>