1.4.0 Word Ladder Challenge Introduction

Video

1.4.0 Word Ladder Challenge Introduction

Manipulating strings is an essential skill for any natural language processing expert. In this lesson you will learn how to twist and change strings. To test your skills, you will have to overcome a series of word ladders.

What is a Word Ladder?

A word ladder is a puzzle where you start with one word and change one letter at a time until you get to a different word. For example, you might start with "dog" and change it to "cat" by changing one letter at a time:

  • dog → cog → cot → cat

The Rules

  1. Change one letter at a time - You can only modify one character per step
  2. Use Python string manipulation - You cannot just reassign the entire string (e.g., puzzle1 = "cat" is not allowed)
  3. Print every step - You must print each word along the way
  4. One blank line between puzzles - Separate each word ladder with a blank line

Starter Code

The starter code below contains three word ladder puzzles. Each puzzle has:

  • A starting word
  • Comments with clues for each step
  • A final print statement showing the target word

We've also included the answers to the riddles in case you want to skip straight to the coding. Either way, watch the video below for the rules for the challenge!

In this project you will learn how to:

  • Slice strings into pieces
  • Reassign variables to modify existing strings

Note: The video shows creating a file in Spyder, but you're using the browser editor. Just type your code directly in the editor below!

Loading Python environment...