Q:

I need help to an assignment in python 3. I need to create a function that Return the nucleotide's complement

The function returns a message like this:
<function contains_sequence at 0x04020270>

However it return the correct anwser but that message cant be in shell.
so my code is this:
def contains_sequence(dna1, dna2):
    """ (str, str) -> bool

    Return True if and only if DNA sequence dna2 occurs in the DNA sequence
    dna1.

    >>> contains_sequence('ATCGGC', 'GG')
    True
    >>> contains_sequence('ATCGGC', 'GT')
    False
    """

    if dna2 in dna1:
        print (True)
    else:
        print (False)

    return contains_sequence

A:

Your function is currently outputing the string "True" or "False", not return the boolean value True or False, then unconditionally returning a reference to the function itself.
You need to return the result of the in comparison, which you can do with
def contains_sequence(dna1, dna2):
    if dna2 in dna1:
        return True
    else
        return False

or more idiomatically
def contains_sequence(dna1, dna2):
    return dna2 in dna1

