В продолжение прошлого поста про цифры в мире строк.
Почему методы 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
🍿 Government Cheese: Apple TV+ Goes Full Surreal with This Wild Comedy
📆Premiere: April 16, 2025
🎭Genre: #Comedy · #Surreal
David Oyelowo (‘Selma’, ‘Nightingale’) leads Government Cheese, a wild, satirical take on the American Dream. Set in 1969, the show follows Hampton Chambers, a con man fresh out of prison who returns to his family with big dreams—only to find they’ve moved on without him. His grand plan? A bizarre invention, a pile of debt, and a “righteous path” full of chaos.
Think Fargo meets Wes Anderson, but with a fresh, Black-led perspective. Apple TV+ is leaning hard into quirky crime comedies, and this one, with Pharrell Williams on the soundtrack, feels like a bold, must-watch gamble 🎶🔥. Will it be a cult classic or just a wild experiment? We’ll find out soon.