10 подписчиков
📑 The special variable "_"
📑 Task
1) What properties of the “_” character do we observe in code cells?
2) How can you restore the properties of this special variable?
10 * 10
print(100 + _)
10 + _
print(100 + _)
10 + _
print(_, __, ___)
_, __, ___ = range(3)
10 + _
print(_)
print(_ * __ * ___)
print(_ * __ * '___')
📑 Answer
1) "_" is a special variable that represents the last returned value
and reassigning "_" convert it into an usual variable
2)
# from builtins import *
# or exit from the session
import os
os._exit(00)
10 * 10
print(100 + _)
10 + _
Около минуты
23 апреля 2024