How can I tell if a string repeats itself in Python?
How can I tell if a string repeats itself in Python? Question: I’m looking for a way to test whether or not a given string repeats itself for the entire string or not. Examples: [ ‘0045662100456621004566210045662100456621’, # ‘00456621’ ‘0072992700729927007299270072992700729927’, # ‘00729927’ ‘001443001443001443001443001443001443001443’, # ‘001443’ ‘037037037037037037037037037037037037037037037’, # ‘037’ ‘047619047619047619047619047619047619047619’, # ‘047619’ ‘002457002457002457002457002457002457002457’, # ‘002457’ ‘001221001221001221001221001221001221001221’, # …