Ранее я уже упоминал о другой фишке из ˍˍ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
A 15-year-old girl in Lesotho, in 1988, got pregnant after swallowing sperm during oral sex. She had no vaginal opening and was stabbed in the stomach after being caught by her ex. Doctors believe sperm from her mouth entered her body through stomach wounds and caused pregnancy. The baby was born via cesarean. 🚼🤯
[Read more]
@googlefactss
#Pregnancy#MedicalFacts#UnusualCases#Science
Pregnant women have one more organ than non pregnant women.
The placenta is a temporary organ that grows in the uterus during pregnancy. It connects the mother and baby through the umbilical cord. It gives the baby oxygen and nutrients and removes waste like carbon dioxide. It also makes hormones that help the pregnancy continue and lets helpful antibodies pass to protect the baby.
"Fun" fact:
After birth, the placenta leaves the body.
Some people keep it and even consume it..
🤰👶🍽
[Read more]
[Don't eat it]
#placenta#pregnancy#humanbody#sciencefacts#biology@googlefactss
"Dekichatta kekkon" (できちゃった結婚) or "dekikon" is a Japanese slang from the late 1990s. It means a marriage due to unplanned pregnancy, like a "shotgun wedding," which is a quick marriage to accept an unplanned pregnancy, named after a father using a shotgun to encourage marriage. 📅🤰💍
[Read More]
@googlefactss
#Japan#Marriage#Slang#Pregnancy#Facts
A cryptic pregnancy is when a woman doesn’t know she’s pregnant. It can happen if she has irregular periods, no typical signs, or gets a negative test.
🤰🚫
[Read more]
@googlefactss
#CrypticPregnancy#Pregnancy#HiddenPregnancy#MedicalFacts