Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- # b_filter_string2.py
- from random import *
- zzz = '''
- Python
- Programming
- Is
- Lots
- Of
- Fun
- These
- are
- what
- words
- that
- remain
- from
- having
- to
- remove
- all
- the
- extra
- data
- '''.strip().splitlines()
- abc = 'abcdefghijklmnopqrstuvwxyz'
- p = ['\n','-'] + [z for z in abc.upper()+abc.lower()]
- for z in range(33,256):
- if chr(z) not in p:
- for i in 'z'*9:
- L = len(zzz)
- x = sorted(zzz,key=len)
- x = choice(x[:L/5])
- x = zzz.index(x)
- r = randint(0, len(zzz[x]))
- t = list(zzz[x])
- t.insert(r, chr(z))
- zzz[x] = ''.join(t)
- 0
- zzz = '\n'.join(zzz)
- print zzz
- t = set(zzz)
- for z in t:
- if z not in p:
- zzz=zzz.replace(z,'')
- 0
- print
- print zzz
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement