Problem 32 of 50

Easy

lightbulb What to do

You have a word made of small letters. You need to change every letter that is not a specific letter to another specific letter. For example, if you want to keep 'b' and change everything else to 'g', you will replace all letters except 'b' with 'g'.

Key Concepts
string manipulation loops conditionals
Examples

Input: 3, 'b', 'g', 'abc'

Output: gbg

Input: 1, 's', 'h', 's'

Output: s

code Python Editor
Loading Python...
Test Results
tips_and_updates Tips for Beginners
  • Focus on understanding the logic, not memorizing syntax
  • Use print statements to debug your code
  • Don't worry about input parsing - the function handles that for you
  • If stuck, try writing out your solution on paper first