Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Industrial programming >> Python

Master Python REPL: Quickly Access the Last Result Using the Underscore

Master Python REPL: Quickly Access the Last Result Using the Underscore

You can obtain the result of the last expression in a Python REPL with the underscore operator, e.g. in the Python REPL this looks like:

>>> 3 * 3
9
>>> _ + 3
12

This works in the IPython shell too. In addition, the IPython shell allows you to use Out[n] to get the value of the expression In[n]. E.g., Out[1] would give us the number 9 in the example below:

In [1]: 3 * 3
Out[1]: 9

In [2]: Out[1] + 3
Out[2]: 12

In [3]: _ + 3
Out[3]: 15

Python

  1. Zirconium in Nuclear Reactors: The Essential Cladding Metal
  2. Molybdenum in Medicine: Advanced Applications in Breast Imaging and Bone Repair
  3. How Digital Twins Revolutionize Manufacturing: Benefits, Applications, and ROI
  4. How Technology Is Transforming Manufacturing: From 3D Printing to Digital Twins
  5. How Plastic Materials Are Revolutionizing Modern Construction
  6. Laser Cutting: Precision & Efficiency in Sheet Metal Prototyping
  7. How Automation is Transforming Manufacturing: Boosting Efficiency & Cutting Costs
  8. The Benefits of Augmented Reality in Industry 4.0
  9. Embrace Cutting-Edge Tech: Transforming Manufacturing for Competitive Edge
  10. How Sensors Power Modern Automobiles: Key Roles and Impact