"Ну и как же нам перекидывать строки ви числа?" спросите вы. Проверять каждый символ, очистив строку от лишних знаков и точек. Потом конвертить допустимые символы в числа и восстанавливать знак, дробную чусть и тд???
Самый быстрый способ это просто "попробовать" 😜
text = "-0.3"
try:
num = float(text)
except ValueError:
print('Dough!')
Всё остальное это уже парсинг и разбор символов для иных целей.
#basic
🌎 Sleeping through winter? The edible dormouse takes hibernation to extremes, snoozing up to 11 months a year in underground burrows to survive food shortages. ✨
#mammals⚡#hibernation⚡#adaptation
👉subscribe Interesting Planet
🌎 In the remote Tibetan Plateau, the Himalayan marmot hibernates for up to 7 months each year. During this deep sleep, its heart rate and body temperature drop dramatically—allowing survival through brutally cold, snowbound winters underground. ✨
#mammals⚡#adaptation⚡#hibernation
👉subscribe Interesting Planet
🇯🇵🐻Au Japon, les ours sortent d’hibernation: un habitant a été tué, un policier blessé, rapporte l’agence Kyodo.
En 2025, treize personnes ont été tuées au Japon à la suite d’attaques d’ours. 230 habitants ont été blessés ou mutilés.
#hibernation#ours#attaques