def sos_odd(n):
    """Solution to exercise R-1.6.

    Write a short Python function that takes a positive integer n and returns
    the sum of the squares of all the odd positive integers smaller than n.
    """
    squares = 0
    for num in range(1, n, 2):
        squares += num ** 2
    return squares