Python Functions
Jump to navigation
Jump to search
def addnum(a,b): result = a +b return result print addnum(4,5)
Problem: find out if the word "dog" is in a string
def dog(mystring): return 'dog' in mystring.lower(): dog('dog ran away') true