On 2019年01月08日, MRAB <python at mrabarnett.plus.com> wrote: > On 2019年01月08日 00:47, ike at koeln.ccc.de wrote: >> You might do something like >>>> if len(a) == 0 or all(i == a[0] for i in a[1:]): >>> You don't need to check the length of the list because if the list is > empty, 'all' will return True anyway. Neat! I expected that a[0] would be executed in that case, but it is not. -- Neil Cerutti