J. Correia Lopes

FEUP/DEI & INESC TEC

User Tools

Site Tools


teach:fpro:lectures:07

T: 16/10/2018

Master in Informatics and Computing Engineering
Programming Fundamentals
Instance: 2018/2019


Lecture #7 :: 16/10/2018

Goals

By the end of this class, the student should be able to:

  • Describe function definition and formal parameters
  • Describe function body and local variables
  • Describe function call, actual parameters or arguments and the flow of execution
  • Describe void functions and fruitful functions that return values

Content

  • 4.1 Functions
  • 4.2 Functions can call other functions
  • 4.3 Flow of execution
  • 4.4 Functions that require arguments
  • 4.5 Functions that return values
  • 4.6 Variables and parameters are local
  • 4.7 Turtles Revisited
  • Exercises

Bibliography

  • Peter Wentworth, Jeffrey Elkner, Allen B. Downey, and Chris Meyers, How to Think Like a Computer Scientist — Learning with Python 3, 2018 (Chapter 4) PDF

Materials

  • J. Correia Lopes, Illustrations presented in class, 07-functions.pdf
  • FPRO, 2018/19, Code present in class, Lecture's on GitHub
  • Brad Miller and David Ranum, Learning with Python: Interactive Edition. Based on material by Jeffrey Elkner, Allen B. Downey, and Chris Meyers (Chapter 6) HTML
  • Peter Wentworth, Jeffrey Elkner, Allen B. Downey, and Chris Meyers, How to Think Like a Computer Scientist — Learning with Python 3 (RLE), 2012 (Chapter 4) HTML

Summary

  • Functions. Function definition and function call. Formal and actual parameters. Flow of execution. Return values.

FPRO, 2018/19

« Previous | Index | Next »

teach/fpro/lectures/07.txt · Last modified: 15/10/2018 21:46 by Correia Lopes