Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # # args = [i[1] for i in input().split()]
- f = open('input.txt')
- # args = [i[1] for i in f.read().split()]
- import sys
- # args = [i[1] for i in sys.argv]
- args = []
- for i in sys.argv:
- for j in i:
- args.append(j)
- a = []
- ua = []
- while(1):
- # b = input()
- b = f.read()
- if(len(b) == 0):
- break
- if('i' in args):
- b = b.lower()
- a.append(b)
- ua.append([1,a[0]])
- for i in range(1, len(a)):
- if(a[i] != ua[-1][1]):
- ua.append([1, a[i]])
- else:
- ua[-1][0] += 1
- for i in ua:
- if(not (('d' in args) or ('u' in args)) or \
- ('d' in args) and not ('u' in args) and (i[0] > 1) or \
- ('u' in args) and not ('d' in args) and (i[0] == 1)):
- if('c' in args):
- print(i[0], end=' ')
- print(i[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement