Python is currently the 2nd most popular programming language, just below JavaScript.  It has a blend of procedural, OOP, and functional programming styles.  It uses a dynamic typing system, meaning that variables take on whatever type they need to be rather than explicitly declaring its type.  In other languages, indentation is used to keep code readable and clear.  In Python, indentation is mandatory.  A single misplaced indent can create an error.

The code below was tested with Python 3.7.4

maze.py


import random

#Will use this dictionary to aid in connecting two cells together
opposites = {'north':'south','south':'north','east':'west','west':'east'}

class Cell:
    def __init__(self,row,column):
       self.row = row
       self.column = column
       self.directions = dict() #an empty dictionary
       self.connections = {'north':False,'south':False,'east':False,'west':False} #False = wall
       self.visited = False
       
    def connect(self,direction):
        self.connections[direction[0]] = True #True = no wall
        self.directions.pop(direction[0])
        direction[1].connections[opposites[direction[0]]] = True #do the same for connecting room
        direction[1].directions.pop(opposites[direction[0]])
    
    #returns all connections that haven't been visited yet as a list of tuples 
    #(direction,connected cell)
    def getDirections(self):
        directions = []
        for direction, cell in self.directions.items():
            if cell.visited == False:
                directions.append((direction,cell))
        return directions
        
class Maze:
    def __init__(self,rows,columns):
        self.rows = rows
        self.columns = columns
        self.grid = [] #The grid of cells
        
        #initialize the grid with cells
        for row in range(rows):
            self.grid.append([])
            for column in range(columns):
                self.grid[row].append(Cell(row,column))

        #Connect cells together
        for row in range(rows):
            for column in range(columns):
                if row > 0:
                    self.grid[row][column].directions['north']=self.grid[row-1][column]
                if row < rows-1:
                    self.grid[row][column].directions['south']=self.grid[row+1][column]
                if column > 0:
                    self.grid[row][column].directions['west']=self.grid[row][column-1]
                if column < columns-1:
                    self.grid[row][column].directions['east']=self.grid[row][column+1]

        self.generate()
                
    def getRandomCell(self):
        #returns a random cell from the grid
        return self.grid[random.randrange(self.rows)][random.randrange(self.columns)]
        
    def generate(self):
        #get a random cell to initiate, mark it visited, and add it to a stack
        cell = self.getRandomCell()
        cell.visited = True
        stack = [cell]
        
        #keep looping until the stack is empty
        while len(stack) > 0:
            cell = stack[-1] #get the top cell
            directions = cell.getDirections()
            
            #if this cell has directions left to choose from, then pick one
            #otherwise, remove this cell from the stack.  It's done
            if len(directions) > 0:
                #pick will be a tuple (direction,connected cell)
                pick = random.choice(directions)
                cell.connect(pick)
                stack.append(pick[1])
                pick[1].visited = True
            else:
                stack.pop()
    
    #loop through the grid and print the cells, leave gaps where there is no wall
    def out(self):
        s = '+'
        for i in range(self.columns):
            s += '--+'
        print(s)
        for row in range(self.rows):
            s = '|'
            for column in range(self.columns):
                if self.grid[row][column].connections['east'] == True:
                    s += '   '
                else:
                    s += '  |'
            print(s)
            s = '+'
            for column in range(self.columns):
                if self.grid[row][column].connections['south'] == True:
                    s += '  +'
                else:
                    s += '--+'
            print(s)


width = int(input("Width? "))
height = int(input("Height? "))
maze = Maze(height,width)
maze.out()