Ранее я уже упоминал о другой фишке из ˍˍ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
🔥 Playbux Airdrop
🔹10 Million PBUX Token and 100,000 USDT Pool
🔹Playbux is in the Binance investment program
👉https://www.playbux.co/pre-listing-quest/?ref=Bso20iOZz00
1️⃣ Click on the link and log in directly with Gmail and connect the wallet.
2️⃣ Enter the tasks and do twitter follow, retweet tasks. Make a claim after the tasks are over.
3️⃣ You can also get points for daily check-in.
#playbux#airdrop#binance#pbux#checkin
🚀 Time to Check In, Go! SmartChain AI Community!
Check in now if you're yet to👇
🔗https://t.me/thegoprojectbot?start=twitter
Here's an another opportunity to increase your daily dose of engagement and rewards! 🎮💰
And once you're in
1. Click "Open App" to get started
2. Tap the Go! token to collect rewards
3. Complete your daily tasks and quests to earn GoXP
Most importantly,
Stay active and climb your way to the top. Your participation paves the way for you 💪
#CheckIn#EarnRewards#GoSmartChain#GoTonapp
-----------------
Join: 🐣X✉️Chat✉️News🤖Discord
Play: 🕹️TON App💻Web App
Info: 🖥Newsletter🌐Website🌐Blog
🔥Redbrick Airdrop
I found a fun airdrop. We will play a very short game and collect daily points and airdrops.
💎https://redbrickland.page.link/6ehG
🔸20M$ investment
🔸Partners with Fusionist team
🔸We collect points by logging in daily
🔸Points will turn into $BRICK tokens.
1️⃣ First, we enter the site and connect wallet in polygon network.
👉https://redbrickland.page.link/6ehG
Ref code : 6ehG
2️⃣ Then we select the avatar and go to the immigraiton page.
👉https://redbrick.land/web3-portal/immigration
3️⃣ On this page we do twitter etc. tasks and play the ghost killing game for 30 seconds.
4️⃣ Then we come to the daily page and play our daily game.
👉https://redbrick.land/web3-portal/daily
#redbrick#airdrop#checkin#BRICK#fusionist#gamefi