Ранее я уже упоминал о другой фишке из ˍˍ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
Бароҳат сафар намоед! Замимаи мобилии мо сафари шуморо қулай ва камташвиш хоҳад кард. Тариқи замима мусофирон имкон доранд ба осони сайёҳати худро ба нақша гирифта, чиптаҳоро бо нархи мувофиқу ҷойи муносиб интихоб намоянд ва маблағи бағоҷи аз меъёр зиёдро пардохт намоянд. Замима барои боргирӣ ба iOS ва Android дастрас мебошад.
📱
Путешествуйте с комфортом! Наше мобильное приложение сделает ваше путешествие более удобным и приятным. При помощи приложения пассажиры легко могут спланировать путешествие, подобрать оптимальный тариф для поездки, выбрать удобное место в салоне и оплатить сверхнормативный багаж. Приложение доступно для скачивания на iOS и Android.
📱
Travel in comfort! Our mobile app will make your journey more convenient and enjoyable. With the app, passengers can easily plan their trip, choose the best fare for their journey, select a comfortable seat, and pay for excess baggage. The app is available for download on iOS and Android.
#сомонэйр#somonair#mobileapp
👨🌾🚛 Dalatek — торговая онлайн-площадка в сфере сельского хозяйства. Мы создали для них мобильное приложение📲@dalatek.uz
Подпишись на нас, чтобы не пропустить новые публикации📢
👨🌾🚛 Dalatek — agro sohasida onlayn savdo platformasi.
#designer#mobileapp#Tashkent#Uzbekistan
Follow us: Telegram · Instagram · Dribbble
Attorney Shield Raises $451.96K
Attorney Shield has successfully raised $451.96K on December 17, 2024. The company focuses on enhancing interactions with law enforcement through its innovative mobile app and technology-driven legal services. For more information, visit their website here.
#AttorneyShield#LegalTech#Funding#AppDevelopment#MobileApp#LawEnforcement#Innovation
SociAbility Raises $1.57M
SociAbility has successfully raised $1.57 million in funding to enhance its platform which assists disabled individuals in locating accessible spaces. The funding will help improve the service by providing detailed and reliable accessibility information. Check it out: SociAbility
#Funding#Accessibility#SociAbility#DisabilitySupport#TechForGood#InclusiveDesign#Startup#Innovation#MobileApp#Investment
🚀 AI TRENDS | YouTube Introduces AI Avatar Tool for Shorts Creators
YouTube has launched a new AI avatar tool designed for Shorts creators, allowing them to generate videos of themselves using prompts. According to NS3.AI, this feature enables creators to produce clips lasting up to eight seconds. The rollout began on Wednesday and is accessible through the YouTube app and YouTube Create. Initially, the tool is available to mobile users worldwide, excluding Europe.
#AI#YouTube#AIAvatar#Shorts#ContentCreation#MobileApp#YouTubeCreate#AITrends#TechNews#CreatorTools
Gripp Secures $1.73M Funding
Gripp has successfully raised $1.73 million as of December 16, 2024. Their innovative QR + Mobile App system streamlines equipment maintenance, provides operational knowledge, and offers essential insights into operations.
#Funding#Gripp#MobileApp#EquipmentMaintenance#OperationalInsights#QRSystem#TechInnovation#Investment#Startup#Efficiency#BusinessSolutions