aaaadaa
ABC 384Problem 32 of 50
EasyWhat 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
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
Python Editor
Loading Python...