В продолжение прошлого поста про цифры в мире строк.
Почему методы 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
Stavropol Considers Holiday for Kurban Bayram: Respect or Tradition Challenge?
On May 27, Governor Vladimirov launched a vote to make Kurban Bayram an official day off. With 80% Russians and 90% Christians, and only 15% Muslims in the region, questions arise about balancing traditions. Why are Muslim holidays recognized officially, but not Orthodox ones? Some see this as risking the identity of the native population under the banner of interethnic friendship.
#Stavropol#KurbanBayram#Religion#Holiday
The main news of Russia and the world ishere.
📣 Lanzamos un grito a los representantes de la cultura callejera de todo el mundo a expresarse en voz alta y mostrar de lo que son capaces!
🔥 Se abrió la inscripción al concurso de la #cultura callejera #KARDO!
🔍 Si eres un representante del breaking, hip-hop, skate, kickscootering, BMX, DJ, workout, tricking, graffiti, parkour, freerunning:
🖥 Inscríbete en el sitio web oficial de KARDO hasta el 17 de abril:
✔️Graba un vídeo
✔️Publícalo en las redes sociales con los hashtags #KARDO#KARDO7
✔️Sube el enlace a tu cuenta personal en el sitio web de #KARDO
❗️Demuestra tus habilidades en cada dirección de la competición y llega a la gran final de las legendarias batallas y el mayor festival callejero.
🔝 Los #TOP-6 ¡recibirán un viaje con todo incluido 💥 (comidas, alojamiento, desplazamiento) a la Gran Final de #Stavropol!