Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
🌎 The tiny Etruscan shrew weighs less than a coin and eats up to twice its body weight daily. Its fast metabolism keeps this mini mammal constantly hunting for insects. ✨
#mammals⚡#shrews⚡#metabolism
👉subscribe Interesting Planet
🌎 Some hummingbirds have the fastest metabolism of any warm-blooded animal, with heart rates reaching over 1,200 beats per minute during flight. These tiny birds must eat constantly to fuel their high-energy lifestyle, sipping nectar from hundreds of flowers every day. ✨
#hummingbird⚡#metabolism⚡#nature
👉subscribe Interesting Planet
The idea that skinny people have fast metabolisms is a myth. Metabolism depends largely on muscle mass—more muscle means higher energy use. Skinny people usually have less muscle, so their metabolism is often slower. Weight and appearance don’t reliably show metabolism speed.
[Read more]
@googlefactss
#Metabolism#MythBusted#Health#Fitness#BodyScience