Introduction

Completed

Python strings are one of the most important and common types in the language. Learning how to interact with strings, including formatting and replacing text, is an essential skill to develop for working with Python code.

Scenario: Create a program to describe facts about the Moon

Imagine that you're creating a program to describe some measurements and other information about the Moon. You'll need to use various string operations to create the output.

What will you learn?

By the end of this module, you'll be able to:

  • Use special string methods.
  • Use variables to introduce values in text.
  • Apply other advanced formatting techniques to change how text is presented.

What is the main objective?

In this module, you'll incorporate string operations when you create a Python program.

Prerequisites

You should be familiar with the concept of programming.

You don't need to install Python to complete this module. You'll use an interactive sandbox to complete the exercises.

If you want to try out the code in the explanations, you might want to work through Get started with Python in Visual Studio Code first, if you haven't already. This module helps you prepare a Python environment.