Ранее я уже упоминал о другой фишке из ˍˍ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
Dear community! 💙
BCMC1 People IEO Airdrop⬇️⬇️⬇️
@bcmc_peopleIEO_airdropbot
✅ Please complete all the tasks and submit details correctly.
💰 Rewards:
- If you complete all tasks you will get 450 BCMC1.
📊Market: CoinMarketCap
💧BOUNTY💧
⏰ Airdrop will end on (UTC) or when there are 5,000 participants.
#BCMC1#BeforeCoinMarketCap#BCMC#Crypto#BCMCToken#Airdrop
🚀BeforeCoinMarketCap NEW AIRDROP🚀
💵Total Reward: 550 BCMC1
💰 Value: $8
📊Market: CoinMarketCap
click here⤵️
💎Airdrop Bot💎
☝️Don't miss out on MLM (Ongoing tokens sale with limited pool).
🥳 Invite buyers with your referral links and earn 10%
GOOD LUCK TO EVERYONE!!!✊🏻
💠Telegram
💠Telegram Channel
💠Twitter
💠Facebook
💠LinkedIn
💠YouTube
💠Website
#BCMC1#BeforeCoinMarketCap#BCMC#Crypto#BCMCToken#Airdrop
💧BeforeCoinMarketCap BOUNTY💧
(For 100 participants only💯)
Make a video about our platform: Post it on your official YouTube channel (3-5 minutes) $50 - $100 in BCMC1 token. We take into account the length and quality of the content.
Example: Please watch this videos for instructions: https://youtu.be/8t1ucZFnyL8 & https://youtu.be/aYrpgGpI074
1 Best video will receive 15,000BCMC1 ($200) and will posted on our social channels.🏆
Mandatory:
✅Describe the People IEO. (Community voting)
✅Describe the People IEO. (Participant projects)
✅Explain the MLM system (Ongoing token sales)
❗️Notice: The channel must have Minimum of 1000 subscribers. Your email will be blacklisted if you submit an old video link or if you do not follow the instructions given.
#BCMC1#BeforeCoinMarketCap#BCMC#Crypto#BCMCToken#bounty#Bounty
💎 BeforeCoinMarketCap New BOUNTY 💎
For 100 participants only💯
Bounty Tasks✅
Make a video about our platform: Post it on your official YouTube channel (3-5 minutes) $50 - $100 in BCMC1 token. We take into account the length and quality of the content.
📍Mandatory:
1. Describe the search window.
2. Describe the Announcement window
3. Explain the MLM system (Ongoing token sales):
4. Describe the promotion website
Best video will receive 20,000BCMC1 ($300) and will posted on our social channels.
📍Bounty Google Form
Notice: The channel must have Minimum of 1000 subscribers. Your email will be blacklisted if you submit an old video link or if you do not follow the instructions given.
#BCMC1#BeforeCoinMarketCap#BCMC#Crypto#BCMCToken#Bounty