Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
Bitcoin on #Bithumb suddenly dropped, trading over 10% below other markets.
Reports say a staff mistake during an airdrop sent 2,000 $BTC($133M) instead of a small KRW reward.
Some users sold it right away, causing the price to drop fast.
JUST IN : 💰🚨Bitcoin on #Bithumb suddenly dropped, trading over 10% below other markets.
Reports say a staff mistake during an airdrop sent 2,000 $BTC($133M) instead of a small KRW reward.
Some users sold it right away, causing the price to drop fast.
➖➖➖➖➖➖➖➖➖
📣@cryptonewstel
✨Vip join⭐️
🚨 DWF Labs has deposited all 170K $CYBER to #Bithumb at $8.6 on average ($1.46M) in 7 transactions over the past 24 hours.
➡️ DWF Labs will earn an estimated profit of $697K (+91.1%) from $CYBER if truly sold just now.
👉 More details: https://platform.spotonchain.ai/signal-details/dwf-labs-closed-the-first-cyber-deal-for-great-profit-516
👉 Visit our discord: https://discord.com/invite/Xh7cReej7n