Finding the number of moves a knight can perform while standing on a given square This is a problem from CodeSignal which can be founded over here
Here is an image on what we have to do:

Code
def map(cell):
    new_cell1 = ''
    
    for i in cell:
        if i == 'a':
            new_cell1 += '1'
        if i == 'b':
            new_cell1 += '2'
        if i == 'c':
            new_cell1 += '3'
        if i == 'd':
            new_cell1 += '4'
        if i == 'e':
            new_cell1 += '5'
        if i == 'f':
            new_cell1 += '6'
        if i == 'g':
            new_cell1 += '7'
        if i == 'h':
            new_cell1 += '8'
            
    new_cell1 += cell[-1]
    return new_cell1
    
def chessKnight(cell):
    cell = map(cell)
    num_of_moves = 0
    
    if (int(cell[0])+1 &lt;= 8 and int(cell[0])+1 &gt; 0) and (int(cell[1])+2 &lt;= 8 and int(cell[1])+2 &gt; 0):
        num_of_moves += 1
        
    if (int(cell[0])-1 &lt;= 8 and int(cell[0])-1 &gt; 0) and (int(cell[1])+2 &lt;= 8 and int(cell[1])+2 &gt; 0):
        num_of_moves += 1
        
    if (int(cell[0])+1 &lt;= 8 and int(cell[0])+1 &gt; 0) and (int(cell[1])-2 &lt;= 8 and int(cell[1])-2 &gt; 0):
        num_of_moves += 1
        
    if (int(cell[0])-1 &lt;= 8 and int(cell[0])-1 &gt; 0) and (int(cell[1])-2 &lt;= 8 and int(cell[1])-2 &gt; 0):
        num_of_moves += 1
        
    if (int(cell[0])+2 &lt;= 8 and int(cell[0])+2 &gt; 0) and (int(cell[1])+1 &lt;= 8 and int(cell[1])+1 &gt; 0):
        num_of_moves += 1
    
    if (int(cell[0])-2 &lt;= 8 and int(cell[0])-2 &gt; 0) and (int(cell[1])+1 &lt;= 8 and int(cell[1])+1 &gt; 0):
        num_of_moves += 1
    
    if (int(cell[0])+2 &lt;= 8 and int(cell[0])+2 &gt; 0) and (int(cell[1])-1 &lt;= 8 and int(cell[1])-1 &gt; 0):
        num_of_moves += 1
    
    if (int(cell[0])-2 &lt;= 8 and int(cell[0])-2 &gt; 0) and (int(cell[1])-1 &lt;= 8 and int(cell[1])-1 &gt; 0):
        num_of_moves += 1
        
    return num_of_moves


Question
The Code works as expected and returns the right answer, but I have just put a bunch of if conditions which doesn't look nice to me. Is there any way to implement the problem but without so much if blocks?
Never use existing function names for new functions
Python already has a function called map() Defining your new map() function can cause a lot of confusion, and undefined behaviour in your program.
By cheating
Since you have asked for an alternate solution, here it is
Being a chess engine developer, I would never calculate something trivial like the number of knight attacks since a simple array of size 64 with the pre-calculated ones can easily work. All you need is a simple function that converts a square like a1 to 0 and h8 to 63.
Here is the implementation,
def str_sq_to_int(sq):
    return (ord(sq[0])-97) + ((ord(sq[1])-49) * 8);

def knightAttacks(cell):
    attacks = [
        2, 3, 4, 4, 4, 4, 3, 2,
        3, 4, 6, 6, 6, 6, 4, 3,
        4, 6, 8, 8, 8, 8, 6, 4,
        4, 6, 8, 8, 8, 8, 6, 4,
        4, 6, 8, 8, 8, 8, 6, 4,
        4, 6, 8, 8, 8, 8, 6, 4,
        3, 4, 6, 6, 6, 6, 4, 3,
        2, 3, 4, 4, 4, 4, 3, 2
    ]
    return attacks[str_sq_int(cell)]

The explanation is simple, the function str_sq_to_int() takes a square like 'a1' and returns an index using the ASCII value of the character to calculate the index. You can also use a simple dictionary to map each square to an index, but this one is easy
Then, it uses a pre-calculated set of values, to return the correct answer.