Ранее я уже упоминал о другой фишке из ˍˍ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
NGCam | XML
Channel for user xml configs for Google Camera 7.4 by Nikita. You will find all configs created for supported devices.
All files will be send to the bot and posted in the channel according to the requirements.
NOTE: Use hashtags there. Starting with#pinned
For our subscribers who may be too busy/occupied and cannot follow the signals every time, you can take great advantage with the investment service.
The package works perfectly for busy traders, beginners or anyone who doesn't want to take risks while trading personally..
You make an investment with us and we trade for you, after 6 to 10 days we return with profits directly to your account/wallet provided.😍✅
If you're interested, send message
Click on the #pinned message and contact #admin
100% GUARANTEED PROFITS ❤️💯
I assure you, this is an opportunity you'll love🤩
@DeleteEventsBot
Qué puede hacer este bot?
Este bot elimina mensajes de eventos (también conocidos como mensajes de acción) en supergrupos.
Idioma: Inglés
(visto en @BotsGram_cu)
#delete, #service, #message, #spam, #helper, #group, #supergroup, #join, #left, #pinned