Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics Types and Branching Numeric

How did he use the history to get back to "0.1 + 0.1 "?

I must have missed to recall the last equation?

2 Answers

Sebastian Guillema
Sebastian Guillema
1,804 Points

Hi Nicole,

I believe he just pressed 'up' on his keyboard. Most shell programs have the arrow keys of 'up' and 'down' to navigate between command history for ease of access.

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,457 Points

Good question! The Python REPL uses the GNU readline library

Section 1.4.2 Commands For Manipulating The History shows that

previous-history (C-p): Move `back' through the history list, fetching the previous command.

Those who find this familiar, you will recognize this as the commandline editing used in Emacs! Take that vim! 🤣

Edit: to be fair, TIL you can use

Ctrl-Alt-J switches from Emacs mode to Vi mode in readline programs.

Alternatively add "set editing-mode vi" to your ~/.inputrc

Post back if you need more help. Good luck!!!