---
Product: Aspose.Slides
Platform: python
Page Type: reference
Canonical URL: https://reference.aspose.org/slides/python/PortionCollection
---

# PortionCollection

## Overview

`PortionCollection` is a class in Aspose.Slides FOSS for Python.
Inherits from: `BaseCollection`, `IPortionCollection`.

Represents a collection of portions.

This class provides 7 methods for working with PortionCollection objects in Python programs.
Available methods include: `add`, `clear`, `contains`, `index_of`, `insert`, `remove`, `remove_at`.
All public members are accessible to any Python application after installing the Aspose.Slides FOSS for Python package.
Properties: `as_i_enumerable`, `count`, `is_read_only`, `length`.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `count` | `int` | Read | Gets the number of elements actually contained in the collection. |
| `is_read_only` | `bool` | Read | Gets a value indicating whether the is read-only. |
| `as_i_enumerable` | `Any` | Read | Gets the as i enumerable. |
| `length` | `int` | Read | Returns the number of elements. |

## Methods

| Signature | Description |
|-----------|-------------|
| `add(value)` | Adds a Portion to the collection |
| `index_of(item)` → `int` | Returns the zero‑based index of the specified Portion, or -1 if absent |
| `insert(index, value)` | Inserts a Portion at the given index, shifting subsequent items |
| `clear()` | Removes all Portion objects from the collection |
| `contains(item)` → `bool` | Indicates whether the collection includes the specified Portion |
| `remove(item)` → `bool` | Removes the first occurrence of the specified Portion and returns true if removed |
| `remove_at(index)` | Removes the Portion at the specified index |

## See Also

- [Aspose.Slides — Enterprise API Reference](https://reference.aspose.com/slides/)