Ранее я уже упоминал о другой фишке из ˍˍ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
#ALPINE/USDT analysis :
#ALPINE is currently in a downtrend, trading below the 200 Exponential Moving Average (EMA) and making new lows. The price is expected to continue its bearish momentum and test lower levels. For a short entry, wait for the price to test the zone and resume its bearish momentum.
TF : 4H
Entry : $0.923
Target : $0.819
SL : $0.991
#ALPINE/USDT analysis :
#ALPINE is in a downtrend, trading below the 200 EMA. The price is currently facing rejection from the resistance zone and is expected to continue its downward movement. look for retracement to enter short positions.
TF : 4H
Entry : $1.094
Target : $0.917
SL : $1.202
#ALPINE/USDT analysis -
#ALPINE is in a downtrend. It is currently experiencing a pullback while finding support over the trendline. Wait for the price to break the trendline for a short entry as the price is expected to face resistance from the 200 EMA and continue its bearish momentum.
TF : 1H
Entry : $1.055
Target : $0.927
SL : $1.124