@googlefactss · Post #40595 · 27.01.2026 г., 11:00
The temperature -40 °C is the same as -40 °F. This is the only temperature where Celsius and Fahrenheit match exactly. 🌡️❄️ @googlefactss #Temperature#Celsius#Fahrenheit#Science#Facts
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #65 · 8 апр.
Небольшой трик с регулярными выражениями который редко вижу в чужом коде. Допустим, вам нужно распарсить простой текст и вытащить оттуда пары имя+телефон. Вернуть всё это надо в виде списка словарей. Возьмем очень простой пример текста. >>> text = ''' >>> Alex:8999123456 >>> Mike:+799987654 >>> Oleg:+344456789 >>> ''' Соответственно, для выделения нужных элементов будем использовать группы. Получится такой паттерн: (\w+):([\d+]+) Как мы будем формировать словарь из найденных групп? >>> import re >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append({ >>> "name": match.group(1), >>> "phone": match.group(2) >>> }) >>> print(results) [{'name': 'Alex', 'phone': '8999123456'}, ...] Можно немного сократить запись используя zip >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append(dict(zip(['name', 'phone'], match.groups()))) Но есть способ лучше! Это именованные группы в regex. Можно в паттерне указать имя группы и результат сразу забрать в виде словаря. >>> for match in re.finditer(r"(?P<name>\w+):(?P<phone>[\d+]+)", text): >>> results.append(match.groupdict()) То есть всё что я сделал, это добавил в начале группы (внутри сбокочек) такую запись: (?P<group-name>...) Теперь найденная группа имеет имя и можно обратиться к ней как к элементу списка >>> name = match['name'] Либо забрать сразу весь словарь методом groupdict() >>> match.groupdict() #tricks#regex
Пребарај: #fahrenheit
@googlefactss · Post #40595 · 27.01.2026 г., 11:00
The temperature -40 °C is the same as -40 °F. This is the only temperature where Celsius and Fahrenheit match exactly. 🌡️❄️ @googlefactss #Temperature#Celsius#Fahrenheit#Science#Facts
@googlefactss · Post #40993 · 30.04.2026 г., 01:37
Crickets can be used to estimate temperature using Dolbear’s Law. The snowy tree cricket is the best species for this method because its chirp rate closely matches temperature changes. 🦗 Count chirps in 14 seconds and add 40 to estimate the temperature in °F. Crickets chirp faster in warm weather and slower in cold because they are cold-blooded. 🌡️ To estimate temperature in °C, count chirps in 8 seconds and add 5. This method is fairly accurate between 5 and 30°C. 🌡️ To convert °F to °C, subtract 32 and multiply by 0.56. 🥵🥶🦗🌡️ [Read more] @googlefactss #Insects#ScienceFacts#Nature#DidYouKnow#celsius#Fahrenheit If you have ideas or feedback contact us: @Googlefactss_Feedback_bot