id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

hint


Define a function hint(color, secret) that takes two parameters: a string (representing a color) and a list of strings (representing a sequence of colors). The function should:
Return:

The color xxx IS in the secret sequence of colors.
where xxx is the color if it is in the list or
The color xxx IS NOT in the secret sequence of colors.
if the color is not in the list.

hint('red', ['red', 'red', 'yellow', 'yellow', 'black']) → 'The color red IS in the secret sequence of colors.'
hint('green', ['red', 'red', 'yellow', 'yellow', 'black']) → 'The color green IS NOT in the secret sequence of colors.'
hint('black', ['red', 'red', 'yellow', 'yellow', 'black']) → 'The color black IS in the secret sequence of colors.'

...Save, Compile, Run (ctrl-enter)

def hint(color, secret):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Copyright Nick Parlante 2017 - privacy