Ранее я уже упоминал о другой фишке из ˍˍ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
Scientists found a new drug, SW033291, that protects the brain’s blood barrier by blocking an enzyme called 15-PGDH. This stops brain damage and memory loss in mice with Alzheimer’s and brain injuries. Unlike other drugs, it does not remove amyloid protein but still keeps the brain safe and working well. The drug worked even when given a day after injury.🧠💊
[Source]
@googlefactss
#Alzheimers#BrainHealth#Memory#Science
lethonomia (n)
pronunciation: leh – tho – NO – mee – uh
language: English
definition: the inability to recall someone’s name
sentence: It’s very embarrassing to be stricken with acute lethonomia when I have to make introductions at a party. 🧠🗣️
[Source]
@googlefactss#Lethonomia#Memory#LanguageDisorders#BrainHealth#CommunicationChallenges
Learning another language may slow brain aging, according to a huge new study. Multilingual people show less cognitive decline compared to those who speak only one language. The study suggests that speaking multiple languages helps keep brain networks active, especially those responsible for memory and attention, protecting the brain from aging effects.
🧠🌍💬
[Read more]
@googlefactss
#BrainHealth#Multilingual#CognitiveScience#Learning#HealthyAging
Some studies found that watching a lot of (internet)pornography can change the brain. Brain scans showed stronger links in areas that control emotions and decisions. People who watch often feel more pleasure but have less self-control. After watching, their thinking and attention get worse. Their facial expressions also show less emotion, like surprise or disgust, even if they say they enjoyed it. These changes are similar to drug addiction. Repeating this behavior can make emotional responses dull and reduce mental sharpness.
More research is needed, but finding people who never watched porn for studies is very difficult to impossible..
🧠📉
[Read more1]
[Read more2]
[Read more3]
[How to stop watching]
@googlefactss
#BrainHealth#Addiction#Pornography#porn#MentalHealth#Neuroscience
👮♂🚫Warning: Even though this post and the following poll are sexual in nature. Rules still apply. Be respectful or face the consequences..