Juliet C. answered 03/23/23
Over 30 years of programming experience with 8+ years teaching
Here is one possible approach, in pseudocode, with some steps at a high-level that would need to be broken down into sub-steps:
One Python technique that is useful for producing the result is to use the zip function inside a list comprehension to make tuples with one guess letter and one target letter for comparison to choose whether to have ‘G’ or ‘B’ in the result and then use the string function join to get back to a string from a list. For example: