""" Week4-3 """

prices = [ 40, 5.3, 7.8, 1 ]
total = 0
for i in range(len(prices)):
    print(i, prices[i])
    total = total + prices[i]
print(total)

###

def findMax(nums):
    maxNum = nums[0]
    for i in range(len(nums)):
        print(maxNum)
        value = nums[i]
        if value > maxNum:
            maxNum = value
    return maxNum

print(findMax([4, 1, 7, 2]))

###

cities = [ ["Pittsburgh", "Allegheny", 302407],
           ["Philadelphia", "Philadelphia", 1584981],
           ["Allentown", "Lehigh", 123838],
           ["Erie", "Erie", 97639],
           ["Scranton", "Lackawanna", 77182] ]

###

gameBoard = [ ["X", "_", "O"],
              ["_", "X", "_"],
              ["_", "_", "O"] ]

for row in range(len(gameBoard)):
    entry = gameBoard[row]
    line = ""
    for col in range(len(entry)):
        line = line + entry[col]
    print(line)
