Ранее я уже упоминал о другой фишке из ˍˍfutureˍˍ , это оператор деления.
from __future__ import division
Суть проста. Раньше сложность типа данных результата поределялась типом самого сложного операнда.
Например:
int/int => int
int/float => float
В первом случае оба операнда int, значит и результат будет int. Во втором float более сложный тип, поэтому результат будет float.
Если нам требуется получить дробное значение при делении двух int то приходилось форсированно один из операндов конверировать в float.
12/float(5) => float
Но с новой "философией" это не требуется. В Python3 "floor division" заменили на "true division" а старый способ теперь работает через оператор "//".
>>> 3/2
1.5
>>> 3//2
1
То есть теперь деление int на int даёт float если результат не целое число.
В классах теперь доступны методы __floordiv__() и __truediv__() для определения поведения с этими операторами.
Данный переход описан в PEP238.
#pep#2to3#basic
#LPT is consolidating within a falling wedge pattern and is currently trading above the support trendline.
A bounce from this level is possible, while a breakout of the pattern would confirm bullish momentum.
Conversely, a breakdown below the wedge could lead to further correction.
#LPT/USDT analysis :
#LPT is currently experiencing a bearish trend, trading below the 200 Exponential Moving Average (EMA). The price has encountered resistance at the 200 EMA and has broken below the established trendline, suggesting further downward momentum. A decline to test the swing low level is anticipated.
TF : 2h
Entry : $5.423
Target : $4.883
SL : $5.740
#LPT/USDT analysis :
#LPT has broken down and retested the previous support zone, which is now acting as resistance for the price. It is anticipated that the price will resume its bearish momentum from the current level and test lower levels. For a short entry, it is advisable to wait for a price retracement.
TF : 1H
Entry : $13.76
Target : $12.78
SL : $14.36
#LPT/USDT analysis :
#LPT is currently consolidating sideways in a correction phase above the 200 EMA. The price is likely to test the support zone and then bounce back from there to test the resistance zone.
TF : 1H
Entry : $14.60
Target : $15.30
SL : $14.25