# Homework 2-4 Starter Code.

# Your name here:

def isOdd(num):
    '''takes an integer as argument and returns True if it is odd, or False if it is even.'''
    return num % 2 == 1


def sumThrough(max_val):
    '''returns the sum of integers from 1 to arg.'''
    #TODO: complete the body
    return 0    # not the correct answer 

# Test your sumThrough function here
print('The sum of integers from 1 to 100 is', sumThrough(100))
print('The sum of integers from 1 to 1,000,000 is', sumThrough(1000000))


def sumOddThrough(arg):
    '''returns the sum of odd integers from 1 to arg.'''
    #TODO: complete the body
    return 0    # not the correct answer

# Test your sumOddThrough function here
print('The sum of odd integers from 1 to 100 is', sumOddThrough(100))
print('The sum of odd integers from 1 to 1,000,000 is', sumOddThrough(1000000))


def isAnElementOf(a, myList):
    ''' returns True if an integer a is in a list of integers myList, False otherwise.'''
    #TODO: complete body
    return False    # not the correct answer
    
# Test your isAnElementOf function here
print('5 belongs in [1, 2, 3, 5, 7] is ', isAnElementOf(5, [1, 2, 3, 5, 7])) # True
print('5 belongs in [1, 2] is ', isAnElementOf(5, [1, 2])) # False


def isASubListOf(myList1, myList2):
    ''' returns True if every element in a list of integers myList1
        is also an element in another list of integers myList2'''
    #TODO: complete body
    return False    # not the correct answer
    
# Test your isASubListOf function here
print('[1, 5] belongs in [1, 2, 3, 5, 7] is ', isASubListOf([1, 5], [1, 2, 3, 5, 7])) # True
print('[1, 5] belongs in [1, 2] is ', isASubListOf([1, 5], [1, 2])) # False



