Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
Matter exists in different states:
● Solid – fixed shape and volume, particles tightly packed.
● Liquid – fixed volume, no fixed shape, particles slide past each other.
● Gas – no fixed shape or volume, particles far apart.
● Plasma – like gas but particles are charged.
● Glass – between solid and liquid, amorphous.
● Superfluid – liquid with no resistance near absolute zero.
● Bose-Einstein Condensate – particles act as one quantum entity.
● Fermionic Condensate – similar to Bose-Einstein but formed by fermions.
● Dropleton – quantum liquid of electrons and holes.
● Degenerate Matter – exists under extreme pressure inside stars or planets.
Matter changes state when energy is added or removed.
[Source]
https://t.me/googlefactss
@googlefactss🔬🌡️#Science#Matter#Physics#Education