"""Code eval Fizz Buzz"""
import sys


def main(filename):
    """Open file and perform fizz_buzz on each line."""
    with open(filename, 'r') as file_handle:
        for line in file_handle:
            fizz_buzz(line)


def divisible(num, denom):
    """Return true if num is divisible by denom, false otherwise."""
    if num % denom == 0:
        return True
    else:
        return False


def fizz_buzz(line):
    """Print correct fizz buzz output given input line."""
    inp = line.split(' ')
    x, y, num = int(inp[0]), int(inp[1]), int(inp[2])
    output = []
    for num in xrange(1, num+1):
        out = ''
        if divisible(num, x):
            out = 'F'
        if divisible(num, y):
            out = '{}B'.format(out)
        if not out:
            output.append(str(num))
        else:
            output.append(out)
    print ' '.join(output)


if __name__ == '__main__':
    filename = sys.argv[1]
    main(filename)

@@ -603,25 +603,8 @@
 1):%0A
-        out = ''%0A
     
@@ -627,16 +627,38 @@
 (num, x)
+ and divisible(num, y)
 :%0A      
@@ -670,14 +670,24 @@
  out
- = 'F'
+put.append('FB')
 %0A   
@@ -683,32 +683,34 @@
 d('FB')%0A        
+el
 if divisible(num
@@ -703,33 +703,33 @@
  divisible(num, 
-y
+x
 ):%0A            o
@@ -734,27 +734,22 @@
  out
- = '%7B%7DB'.format(out
+put.append('F'
 )%0A  
@@ -758,18 +758,30 @@
     
+el
 if 
-not out
+divisible(num, y)
 :%0A  
@@ -808,16 +808,11 @@
 end(
-str(num)
+'B'
 )%0A  
@@ -849,19 +849,24 @@
 .append(
-out
+str(num)
 )%0A    pr

make more pythonic.