Ранее я уже упоминал о другой фишке из ˍˍ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
WEREWOLF ROLEPLAY💥
Desa paling micin..
Temukan teman asik, jodoh. Dan keluarga, dimana kamu bebas mau jadi apa aja disini.
Baper tanggung sendiri
📍@wwroleplayID
🔈@channelwwroleplay
#Indonesia#roleplay
❝☺️I drank way too much last night, thanks for taking me home, you're a lifesaver! ❞
🔗Keep the story going with her: http://openlove.life
#AIgirlfriend#roleplay#AIchatbot#lookbook
𝑾𝒆𝒍𝒄𝒐𝒎𝒆 𝒕𝒐 𝑪𝒍𝒖𝒃 𝑳𝒆𝒙𝒙𝒙
Lexxx is a nightclub-themed furry forum group that focuses on roleplaying inside a nightclub in our Roleplay_Chat however, our group is not exclusively for roleplaying as we also offer a General_Chat which is our main chat where you can discuss almost about anything. The OOC_Chat is our out of character chat where you can discuss and plan out roleplay scenes inside our club. You can also request your own roleplay plot in our Roleplay_Ads chat.
#OOC#Roleplay#Kinky#Nightclub#Anthro#NSFW
❝Let this love ripple in the spring pond. 🌸💕💦❞
💬Keep the story going with her: http://openlove.life
#aigirlfriend#aichat#ai美女#roleplay#AIBeautifulWomanな人と繋がりたい
❝Come on, hurry up,
my husband will be home in 15 minutes.❞
🔥Roleplay with her: http://openlove.life
(Choose Neko and chat with her)
#waifu#neko#aichatbot#aigame#roleplay#catgirl
❝There is no perfume today, so your girlfriend won't notice.❞
💬Chat with her: https://apple.co/3AvjxUn
#AIgirlfriend#chatbot#roleplay#story#aigame#lookbook
🔥❝Welcome! Thanks for choosing me to serve you.
💦Shall we take a shower first?❞
🍭Roleplay with her: openlove.life
#openlove#aigirlfriend#aigame#aichatbot#ai女優#roleplay
❝Among all the flight attendants, I love you the most, Captain.❤️🔥❞
💗Accept or reject her one-night stand invitation:
openlove.life
#aichatbot#aigirlfriend#waifu#roleplay#AIBeautifulWomanな人と繋がりたい#aiphotos