A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.wolfram.com/language/fast-introduction-for-programmers/en/iterators/ below:

Wolfram Language Fast Introduction for Programmers

Iterators | Wolfram Language Fast Introduction for Programmers WOLFRAM Products

More mobile apps

Core Technologies of Wolfram Products Deployment Options From the Community Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

WolframConsulting.com

Wolfram Solutions

More Wolfram Solutions

Wolfram Solutions For Education

More Solutions for Education

Learning & Support Get Started More Learning Grow Your Skills Tech Support Company Work with Us Educational Programs for Adults Educational Programs for Youth Read Educational Resources Wolfram Initiatives Events Wolfram|Alpha Wolfram Cloud Your Account Search Navigation Menu The Wolfram Language:
Fast Introduction for Programmers
Show additional notes for:
All sections  Get Started Iterators Video Version

Notes for Java programmers:

Not to be confused with Java's Iterator interface, the Wolfram Language's iterator notation reduces the code required for repetitive operations. Generally, these iterators are used for tasks that would require loops in Java.

Make a table of the first 10 squares:

In[1]:= Out[1]=

Many functions in the Wolfram Language use the standard "iterator specification": min, max, step:

In[2]:= Out[2]=

Notes for Java programmers:

In Java, iterative operations like this would require a for or while loop.

An alternative iterator specification just gives an explicit list of values:

In[3]:= Out[3]=

Notes for Java programmers:

Using Table this way is analogous to iterating over a Java array or collection with a foreach construct.

Notes for Python programmers:

Using Table in this way is analogous to using the [... for ... in ...] list comprehension construct in Python, though it has somewhat richer semantics.

This makes a nested table:

In[1]:= Out[1]=

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4