Ранее я уже упоминал о другой фишке из ˍˍ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
🛠️Solución de Problemas con Doppler a Color:
•⚡ Verifica Preset: Asegúrate de usar el preset abdominal en lugar del cardíaco.
•📉 Escala Doppler: #Reduce la escala de Doppler para mejorar la visualización del flujo.
•📈 Gana Color: Incrementa la ganancia del color evitando sobrecargar de artefactos.
•🔄 Ajusta Inclinación: Cambia ligeramente el ángulo del transductor para optimizar la imagen.
•💡 Doppler Power 💪: Si el flujo no se visualiza bien, cambia al Doppler Power para detectar flujos de baja velocidad.
📊 Doppler Pulsado (PW):
•🎯 Posiciona el Volumen de Muestreo: Sobre los vasos interlobares para observar:
•🔻 Flujo Venoso: Aparece debajo de la línea base.
•🔺 Flujo Arterial: Aparece por encima de la línea base.
As we prepare for Christmas, let's transform and reuse our old decor for a fresh festive look.
Instead of buying new decorations, wrapping paper and cards, we can:
🎄 Paint a fresh coat on old ornaments
🎁 Reuse empty food jars or cookie tin cans as gift boxes
📱 Swap Christmas paper cards for heartfelt e-greetings
How are you getting creative with upcycling and recycling this Christmas? Share your tips in the comments below.
#TowardsZeroWaste#3Rs#Reduce#Reuse#Recycle
Our 2023 Wrapped is in!
'Bringing Your Reusable Bag for Shopping' is the chart-topping single we all need.
From reusable essentials to recycling mastery, we've built an eco-habit playlist that's pure chart green. Top tracks include 'Reusable Bag Groove', 'Recycling Rhythm', and 'Energy-Saving Melody'.
Fellow eco-warriors, let’s keep this #SustainableSG chart-topper habit going strong!
#TowardsZeroWaste#BYOB#BringYourOwnBag#BringYourOwn#BYO#3Rs#Reduce#Reuse#Recycle#EnergyEfficiency