Close
Close window
__iter__ - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

__iter__

return iterator to traverse the Indexable

Calling Sequence

x.__iter__()

iter(x)

Parameters

x

-

Indexable object

Description

__iter__ function returns a Python Iterator object for the Indexable x.

This allows Python-style iteration over the elements contained in the Indexable.

This function can also be called by simply entering iter(x) or used implicitly, such as in a for-in loop.

Examples

The following interactive session illustrates the use of an iterator used implicitly in a for-in loop over the container structure.

>>> import maplesoft.maple as mpl

>>> S = mpl.execute('{3,4,2*Pi,sqrt(2)};')

>>> for x in S: print(x)

3

4

2^(1/2)

2*Pi


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /