---
title: get_cell_at
description: Returns the cell at the given location if it exists.
---

## Signature

```py
def get_cell_at(location: Location) -> Cell | None
```

## Description

Returns the `Cell` object at the specified `location` if it exists on the map.  
If the location is out of bounds or invalid, returns `None`.

## Example

```py
# world has height and width set to 3 for this example.
 
# Valid location
loc = Location(1, 1)
print(get_cell_at(loc))
 
# Outputs:
Cell ( ... )
 
# Invalid location
loc = Location(4, 1)
print(get_cell_at(loc))
 
# Outputs:
None
```
