J. Correia Lopes

FEUP/DEI & INESC TEC

User Tools

Site Tools


teach:fpro:lectures:10

T: 25/10/2018

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


Lecture #10 :: 25/10/2018

Goals

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

  • Describe how to work with strings as single things
  • Describe how to work with the parts of a string
  • Enumerate the main methods available to work with strings
  • Describe how to format strings

Content

  1. Data types
    • 5.1.1 A compound data type
    • 5.1.2 Working with strings as single things
    • 5.1.3 Working with the parts of a string
    • 5.1.4 Length
    • 5.1.5 Traversal and the for loop
    • 5.1.6 Slices
    • 5.1.7 String comparison
    • 5.1.8 Strings are immutable
    • 5.1.9 The in and not in operators
    • 5.1.10 A find function
    • 5.1.11 Looping and counting
    • 5.1.12 Optional parameters
    • 5.1.13 The built-in find method
    • 5.1.14 The split method
    • 5.1.15 Cleaning up your strings
    • 5.1.16 The string format method
    • Exercises

Bibliography

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

Materials

  • J. Correia Lopes, Illustrations presented in class, 10-strings.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 9) 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 8) HTML

Summary

  • Compound data types. Strings. Working with strings. Operations with strings. Format strings. Strings are immutable.

FPRO, 2018/19

« Previous | Index | Next »

teach/fpro/lectures/10.txt · Last modified: 02/11/2018 18:41 by Correia Lopes