Solutions will be available when this assignment is resolved, or after a few failing attempts.

Is Char in String

Use a for loops to complete the function char_in_string to check if char_to_look_for is in a_string.

Do NOT use the in keyword to determine if it is in there.

Return True if it is there and False if it is not.


>>>  char_in_string("abcdef", "X")

>>>  char_in_string("abcXdef", "X")

Note: If you find the character, you can leave the loop early by using a break or a return statement.

Test Cases

test char not in string - Run Test

def test_char_not_in_string():
    assert char_in_string("abcdef", "X") == False

test char in string - Run Test

def test_char_in_string():
    assert char_in_string("abcXdef", "X") == True
def char_in_string(a_string, char_to_look_for): pass