JCL

FEUP/DEI & INESC TEC

User Tools

Site Tools


teach:fpro:lectures:07

LE07: 02/11/2020

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


Lecture #7 :: 02/11/2020

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

  • 5.1 Data types: Strings
    • 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

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 5.1)

Materials

Summary

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

FPRO, 2020/21

« Previous | Index | Next »

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