x = list(input("Введите число: "))
tmp = ''
for i in a:
if i == tmp:
print('Повторяется символ',tmp)
tmp = i
for i in range(1,len(a)-1):
if a[i] == a[i-1]:
print('Повторяется символ',a[i])
>>> class Test:
def __init__(self,value):
self._value = value
#
def __lt__(self,other):
if type(other) != Test:
raise ValueError('comparing object must be of type Test')
return self._value < other._value
... ... ... ... ... ... ... ...
>>> a = Test(10)
>>> b = Test(20)
>>> a < b
True
>>> a > b
False
>>> a < 3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 7, in __lt__
ValueError: comparing object must be of type Test