In

In[n]

is a global object that is assigned to have a delayed value of the n^(th) input line.

Details

  • Typing In[n] causes the n^(th) input line to be reevaluated.
  • In[] gives the last input line.
  • In[-k] gives the input k lines back.

Examples

open allclose all

Basic Examples  (1)

Reevaluate a command without retyping it:

Scope  (1)

Add some integers:

Retrieve the input that produced the first output without allowing it to evaluate:

Allow the input to evaluate:

Applications  (1)

Evaluate some expressions:

Reevaluate the third input 4 more times:

Verify the convergence to :

Evaluate DownValues for In to see what inputs are stored in this session:

Get the same data using Information. Here this only includes definitions from this example:

Properties & Relations  (3)

Referencing an input number greater than the total number of inputs returns unevaluated:

If $HistoryLength is finite, only the $HistoryLength-1 most recent values of In have a value:

The value of $Line corresponds to the numbers in In and Out:

Wolfram Research (1988), In, Wolfram Language function, https://reference.wolfram.com/language/ref/In.html.

Text

Wolfram Research (1988), In, Wolfram Language function, https://reference.wolfram.com/language/ref/In.html.

CMS

Wolfram Language. 1988. "In." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/In.html.

APA

Wolfram Language. (1988). In. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/In.html

BibTeX

@misc{reference.wolfram_2024_in, author="Wolfram Research", title="{In}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/In.html}", note=[Accessed: 17-January-2025 ]}

BibLaTeX

@online{reference.wolfram_2024_in, organization={Wolfram Research}, title={In}, year={1988}, url={https://reference.wolfram.com/language/ref/In.html}, note=[Accessed: 17-January-2025 ]}