2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

R、Julia、Pythonの前回の実行結果変数

Posted at

REPL (Read-Eval-Print Loop)では、前回の実行結果を利用したい場合があります。
その時は用意されている変数を使いましょう。
言語によっては違いますけど、面白いところでもあると思います。

Julia:

ans

Python:※(アンダースコア)

_

R:

.Last.value

Julia: ans

image.png

Python: _ (アンダースコア)

image.png

Juliaと若干違いますが、変数定義の結果は出力しないため、「_」ではエラーになる場合があります。

R: .Last.value

image.png

以上

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?