В продолжение прошлого поста про цифры в мире строк.
Почему методы 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
Sen. Bernie Sanders (D-VT) got animated during an interview with CNN's Kaitlan Collins on Tuesday night over President Donald Trump's latest threat to withhold federal funding from New York City.
Sanders joined Collins to discuss the looming government shutdown. He expressed concern that the Trump administration could use the shutdown to continue advancing its authoritarian agenda, citing previous examples like firing workers that "they don't like" from the Veterans Administration and making significant cuts to Medicaid.
"I'll give you another example, as I'm sure you've heard of it," Sanders told Collins. "I think it was yesterday. Trump says, 'Well, if Mr. [Zohran] Mamdani becomes the mayor of New York City, then I'm going to cut funding from New York City.'"
#Trump#Sanders
👂More on Trump's Ear ⚠️
✊ As Senator Bernie Sanders and Representative Alexandria Ocasio-Cortez joined Zohran Mamdani on Sunday at Forest Hills Stadium, a bigger test for the left may still lie ahead. 🌆📣
#NY#Mamdani#Sanders
👂More on Trump's Ear
⚠️
🇺🇸 Spinto da giovani e ispanici, Bernie #Sanders ha stravinto i #caucus del #Nevada.
➡️ Tutti i risultati e l'analisi del voto:
https://www.youtrend.it/2020/02/24/come-bernie-sanders-ha-vinto-in-nevada/
#USA#Primarie#D
Secondo il WP, gli stretti collaboratori di Bernie #Sanders (#VPP|Sinistra) riferiscono che il Senatore sarebbe pronto a candidarsi alle primarie democratiche nel 2024, qualora il presidente in carica Joe #Biden rifiutasse di correre per la rielezione.
@UltimoraPolitics
#USA#Ucraina#Israele#Taiwan
Il #Senate ha approvato, con 67 voti favorevoli e 27 contrari, la chiusura dell’accordo per la fornitura di aiuti per un ammontare pari a 95 miliardi di dollari a Ucraina, Israele e Taiwan.
Anche 18 senatori repubblicani hanno votato a favore dell’accordo, mentre Bernie #Sanders (#D|Centro-sinistra) è stato l’unico dem ad opporsi alla fornitura di aiuti a tali nazioni.
@OsservatorioEsteri
Attualmente, Joe #Biden ha un vantaggio larghissimo in #Mississippi e #Missouri, un vantaggio ampio in #Michigan e un vantaggio molto ristretto in #NorthDakota.
Bernie #Sanders invece ha un vantaggio ristretto in #Idaho, #Washington e fra i #DemocratsAbroad