Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
Prince William presents Earthshot climate prizes
Milan and Costa Rica were among the winners of the Earthshot Prize, an environmental award created by Britain's Prince William, who has criticized world leaders for an uninspiring response to the climate change crisis.
#News#Reuters#Climate#Award#PrinceWilliam
Subscribe: http://smarturl.it/reuterssubscribe
Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled.
Get the latest news on: http://reuters.com/
Follow Reuters on Facebook: https://www.facebook.com/Reuters
Follow Reuters on Twitter: https://twitter.com/Reuters
Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en
➖@reutersworldchannel➖
UK's Prince William says great minds should focus on saving Earth not space travel
Britain's Prince William takes veiled swipe at the billionaires embroiled in a space tourism race, saying the world's greatest brains should instead be focused on solving the environmental problems.
#PrinceWilliam#Britain#UK#Royals#SpaceTourism#ClimateChange#Earth#Environment#News#Reuters
Subscribe: http://smarturl.it/reuterssubscribe
Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled.
Get the latest news on: http://reuters.com/
Follow Reuters on Facebook: https://www.facebook.com/Reuters
Follow Reuters on Twitter: https://twitter.com/Reuters
Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en
➖@reutersworldchannel➖
#JuanOSavin#MattLeTissier#TomNumbers#WriteSideBlonde
Mar-a-Lago Trees cut down, #Trump Arrest, #FBI Trump wants #Peace State of play in England #KingCharles#PrinceWilliam Thirteen #Bloodline families #Israel#Zion#Resurrection#Christ#SecondComing#Magnetics#Electric Fields & much much more
https://youtu.be/KOYL4eATX5o👈🏻🌴🎺🔥🇺🇸🇬🇧🕊🧊