I have a program that prints strings consisting of a random sequence of lowercase letters and spaces.
Is there a way emphasize a certain target word within that string when I print the string to make the target easier to spot in the output?
For example:
Current code:
>>> print(mystring)
mxxzjvgjaspammttunthcrurny dvszqwkurxcxyfepftwyrxqh
Desired behaviour:
>>> some_function_that_prints_with_emphasis(mystring,'spam')
mxxzjvgjaspammttunthcrurny dvszqwkurxcxyfepftwyrxqh
Other acceptable forms of emphasis would be:
- boldening the characters
- changing colour
- capitalizing
- separating with extra characters
- any other idea that is easily implemented in Python 3
I'm leaving the requirements deliberately vague because as a beginner I'm not aware of all that Python can do so there might be a simpler way to do this that I've overlooked.