JCL

FEUP/DEI & INESC TEC

User Tools

Site Tools


teach:fpro:lectures:03

LE03: 19/10/2020

Master in Informatics and Computing Engineering
Programming Fundamentals
Instance: 2020/2021


Lecture #3 :: 19/10/2020

Goals

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

  • Describe how to import and do simple graphics with the module "turtle"
  • Describe an instance of Turtle, its own attributes and methods
  • Describe the flow of execution of the for loop
  • Describe the range function
  • Describe conditionals and selection
  • Describe Boolean values, logical operators, and expressions
  • Describe the use of if-then-else blocks for conditional execution

Content

  • 3.1. Program flow (with Turtles)
    • 3.1.1 Our first turtle program
    • 3.1.2 Instances — a herd of turtles
    • 3.1.3 The for loop
    • 3.1.4 Flow of Execution of the for loop
    • 3.1.5 The loop simplifies our turtle program
  • 3.2. Conditionals & selection
    • 3.2.1 Boolean values and expressions
    • 3.2.2 Logical operators
    • 3.2.3 Truth Tables
    • 3.2.4 Simplifying Boolean Expressions
    • 3.2.5 Conditional execution
    • 3.2.6 Omitting the else clause
    • 3.2.7 Chained conditionals
    • 3.2.8 Nested conditionals
    • 3.2.9 Logical opposites

Bibliography

  • Peter Wentworth, Jeffrey Elkner, Allen B. Downey, and Chris Meyers, How to Think Like a Computer Scientist — Learning with Python 3, Release 3rd Edition, 2020 [PDF] (Section 3.1 & Section 3.2)

Materials

Summary

  • Import a module. Simple graphics in Python. Flow of execution of the for loop. The range function. Conditionals and selection. Boolean values and expressions. Logical operators. Conditional execution. If-then-else and nested conditionals.

FPRO, 2020/21

« Previous | Index | Next »

teach/fpro/lectures/03.txt · Last modified: 03/01/2021 17:39 by Correia Lopes