samworld.py
def find_position(tile_type, level, tile_size):
    """Finds the first occurence of the given tile type found in the level, and returns the x,y coordinates of its
    centre as a 2-tuple. If not found, returns 0,0"""
    
    # iterate through all the level tiles
    for j, row in enumerate(level):
        for i, tile in enumerate(row):
        
            # if this tile is the desired type, return its centre coordinates
            if tile == tile_type:
                return (i+0.5)*tile_size, (j+0.5)*tile_size             
                
    # if we got this far, the tile type wasn't found. Return default of 0,0
    return 0.0, 0.0
Finds the first occurence of the given tile type found in the level, and returns the x,y coordinates of its
    centre as a 2-tuple. If not found, returns 0,0
Finds the first occurence of the given tile type found in the level, and returns the x,y coordinates of its
centre as a 2-tuple. If not found, returns 0,0
Finds the first occurence of the given tile type found in the level and returns the x y coordinates of its centre as a 2 - tuple . If not found returns 0 0
def find_position(tile_type, level, tile_size):
    for j, row in enumerate(level):
        for i, tile in enumerate(row):
            if tile == tile_type:
                return (i+0.5)*tile_size, (j+0.5)*tile_size             
    return 0.0, 0.0
def find_position ( tile_type , level , tile_size ) : for j , row in enumerate ( level ) : for i , tile in enumerate ( row ) : if tile == tile_type : return ( i + 0.5 ) * tile_size , ( j + 0.5 ) * tile_size return 0.0 , 0.0
Finds the first occurence of the given tile type found in the level, and returns the x,y coordinates of its
centre as a 2-tuple.
Finds the first occurence of the given tile type found in the level and returns the x y coordinates of its centre as a 2 - tuple .
"""Finds the first occurence of the given tile type found in the level, and returns the x,y coordinates of its
    centre as a 2-tuple. If not found, returns 0,0""" # iterate through all the level tiles # if this tile is the desired type, return its centre coordinates # if we got this far, the tile type wasn't found. Return default of 0,0
tile_type
level
tile_size