NIKOLAY_TETUS

24 задание

Jun 23rd, 2021
672
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. f = open("24 (1).txt")
  2. data = f.read()
  3.  
  4. maxPosl = 0
  5. nowPosl = 0
  6. for i in range(1, len(data)):
  7.     if data[i] == data[i-1]:
  8.         nowPosl += 1
  9.         if nowPosl > maxPosl:
  10.             maxPosl = nowPosl
  11.     else:
  12.         nowPosl = 0
  13. print(maxPosl)
  14.        
  15.  
RAW Paste Data