В продолжение прошлого поста про цифры в мире строк.
Почему методы isdigit() и isnumeric() не определяют в строке float и отрицательные значения?
Дело в том, что эти методы работают с ЦИФРАМИ, то есть с единичным символом. А строка "-2" или "3.4" это уже ЧИСЛО. То есть не символ а значение, записанное несколькими символами.
Все озвученные методы проходятся по каждому символу строки и проверяют их индивидуально.
В юникоде есть символы цифр с точками "🄀⒈⒉⒊⒋⒌⒍⒎⒏⒐"
Каждая из них это ОДИН СИМВОЛ, поэтому он будет считаться цифрой
>>> '⒌'.isdigit(), '⒌'.isnumeric()
True, True
Но когда мы пишем это выражение в два символа ( 5+точка), то это не работает.
>>> '5.'.isdigit(), '5.'.isnumeric()
False, False
А еще есть такие символы
>>> '⑴⑵⑶⑷⑸'.isdigit()
True
>>> '🄁🄂🄃'.isdigit()
True
Но они не преобразуются в десятичные цифры
>>> '⒈'.isdecimal()
False
>>> '🄃'.isdecimal()
False
>>> '⑶'.isdecimal()
False
#basic
🌍Urho Kekkonen National Park, Finland
📏
📏
📏
📏
📏
📏
📏
📏
⭐ Urho Kekkonen National Park offers breathtaking wilderness, with pristine forests, peaceful lakes, and an untouched natural landscape.
📏
📏
📏
📏
📏
📏
📏
📏
#Finland🇫🇮@voyage
🎅Santa Claus Village👋
📏
📏
📏
📏
📏
📏
📏
📏
🟠According to tradition, Santa Claus was born in Lapland. His village is considered his official home, making it one of Finland’s most visited tourist attractions.
📏
📏
📏
📏
📏
📏
📏
📏
#Finland🇫🇮@voyage
📍Finland🇫🇮
Finland is known as the "land of a thousand lakes," celebrated for its rich natural beauty, untouched lake landscapes, and pristine forests. 🌲🏞️
The homeland of the Moomin trolls and Santa Claus, the land of a thousand lakes, the land of the midnight sun – this is how Finland is commonly described. 🎅🌅
The Finns themselves call their country Suomi, which means "land of the swamps." 🌿
#Finland
@voyage
Aalto University Summer Program 2026 in Finland 🇫🇮 (Fully Funded) 🇪🇺
Visit: https://opportunitiescorners.com/aalto-university-international-summer-program/
Open to all Nationals. No Application Fee.
The Program Covers Airfare, Stipend, Accommodation, Food.
Deadline: 31st Jan 2026
#Finland#OpportunitiesCorners