Attachment '2012-11-09.cifry.py'
Download 1 #!/usr/bin/env python
2 # coding: utf
3 '''
4 В заданной строке найти длину самой длинной последовательности цифр
5 '''
6
7 string = raw_input("Введите строку с цифрами: ")
8 digits = "0123456789"
9 count, maxcount = 0, 0
10 for c in string+" ": # В конце строки должна быть не цифра
11 if c in digits:
12 count += 1
13 else:
14 if maxcount < count:
15 maxcount = count
16 count = 0
17
18 print maxcount
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.- [get | view] (2012-11-15 19:57:33, 0.5 KB) [[attachment:2012-11-09.cifry.py]]
- [get | view] (2012-11-22 19:36:51, 1.2 KB) [[attachment:2012-11-09.f2n.rec.py]]
- [get | view] (2012-11-15 19:57:57, 0.8 KB) [[attachment:2012-11-09.powtor.py]]
- [get | view] (2012-11-15 19:57:14, 1.2 KB) [[attachment:2012-11-09.slowo.py]]
You are not allowed to attach a file to this page.