Manipulate and format string data for display in Python

Visual Studio

Use built-in features of the string class and other helper methods to control string data.

Learning objectives

In this module, you will:

  • Use escape characters in literal strings to add new lines and tabs.
  • Use features of the print() function to format strings for display.
  • Call one of many built-in functions to strip empty spaces, add padding, and find and replace substrings.
  • Use the format() function to create a format string that contains a series of replacement fields.


  • Know how to create a working folder and add code files.
  • Know how to run a Python code file by using either tooling support in Visual Studio Code or the command line.
  • Understand how you can pass values as arguments to a function.
  • Have experience with the print() function, variables and literal strings, and numeric data.
  • Have awareness of calling helper functions on a data type, a literal value, and a variable.