I have a question in regard to time complexity (big-O) in Python. I want to understand the general method I would need to implement when trying to find the big-O of a complex algorithm. I have understood the reasoning behind calculating the time complexity of simple algorithms, such as a for loop iterating over a list of n elements having a O(n), or having two nested for loops each iterating over 2 lists of n elements each having a big-O of n\*\*2. But, for more complex algorithms that implement multiple if-elif-else statements coupled with for loops, I would want to see if there is a strategy to, simply based on the code, in an iterative fashion, to determine the big-O of my code using simple heuristics (such as, ignoring constant time complexity if statements or always squaring the n upon going over a for loop, or doing something specific when encountering an else statement).

I have created a battleship game, for which I would like to find the time complexity, using such an aforementioned strategy.

```py

from random import randint

class Battle:
    def __init__(self):

        self.my_grid = [[False,False,False,False,False,False,False,False,False,False],[False,False,False,False,False,False,False,False,False,False],[False,False,False,False,False,False,False,False,False,False],[False,False,False,False,False,False,False,False,False,False],[False,False,False,False,False,False,False,False,False,False],[False,False,False,False,False,False,False,False,False,False],[False,False,False,False,False,False,False,False,False,False],[False,False,False,False,False,False,False,False,False,False],[False,False,False,False,False,False,False,False,False,False],[False,False,False,False,False,False,False,False,False,False]]

    def putting_ship(self,x,y):
        breaker = False
        while breaker == False:
            r1=x
            r2=y
            element = self.my_grid[r1][r2]

            if element == True:
                continue
            else:
                self.my_grid[r1][r2] = True
                break

    def printing_grid(self):
        return self.my_grid

    def striking(self,r1,r2):

        element = self.my_grid[r1][r2]
        if element == True:
            print("STRIKE!")
            self.my_grid[r1][r2] = False
            return True
        elif element == False:
            print("Miss")
            return False

def game():
    battle_1 = Battle()
    battle_2 = Battle()

    score_player1 = 0
    score_player2 = 0
    turns = 5

    counter_ships = 2

    while True:
        input_x_player_1 = input("give x coordinate for the ship, player 1\n")
        input_y_player_1 = input("give y coordinate for the ship, player 1\n")

        battle_1.putting_ship(int(input_x_player_1),int(input_y_player_1))

        input_x_player_2 = randint(0,9)
        input_y_player_2 = randint(0,9)

        battle_2.putting_ship(int(input_x_player_2),int(input_y_player_2))

        counter_ships -= 1
        if counter_ships == 0:
            break

    while True:
        input_x_player_1 = input("give x coordinate for the ship\n")
        input_y_player_1 = input("give y coordinate for the ship\n")

        my_var = battle_1.striking(int(input_x_player_1),int(input_y_player_1))

        if  my_var == True:
            score_player1 += 1
            print(score_player1)

        input_x_player_2 = randint(0,9)
        input_y_player_2 = randint(0,9)

        my_var_2 = battle_2.striking(int(input_x_player_2),int(input_y_player_2))

        if  my_var_2 == True:
            score_player2 += 1
            print(score_player2)

        counter_ships -= 1
        if counter_ships == 0:
            break

    print("the score for player 1 is",score_player1)
    print("the score for player 2 is",score_player2)

print(game())

```