Create a solution that detects the presence of a character in a string.
Python
def detect_character(string, char):
    for ch in string:
        if ch == char:
            return True
    return False

string = 'Python'
char = 'y'
print(detect_character(string, char))