> ## Documentation Index
> Fetch the complete documentation index at: https://python-training.ipoint-labs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lab 29: Scope detective

> Hands-on lab · 15 min · Module 11

Predict which variable each line uses, then fix a counter that stops with an `UnboundLocalError` and replace its `global` with a return value.

[Open Lab 29 in the IP Lab Portal](https://labs.intellectualpoint.com/labs/pcep-lab-29-scope-detective)

## What you will practice

* Spot local and global names
* Reproduce and fix an `UnboundLocalError`
* Refactor a `global` into a return value

## Before you start

Time
15 minutes
*Hands-on in Python 3*

Where
IP Lab Portal
*labs.intellectualpoint.com*

Module
Module 11: Flexible arguments and scope
*PCEP-30-03*

* In the IP Lab Portal, open **Lab 29 - Scope detective**.
* In class, this lab comes right after the **Lesson 4 recap** slide in [Module 11 core material](https://python-training.ipoint-labs.com/pcep/module-11/material.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.