Advertisement
Guest User

lab9

a guest
May 20th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. import functools
  2. def comp(a, b):
  3.     if len(a) >= len(b):
  4.         return a
  5.     else:
  6.         return b
  7. s = input()
  8. print(len(list(filter(lambda x: x == '(', s))) == \
  9.       len(list(filter(lambda x: x == ')', s))))
  10. print(functools.reduce(comp, s.split()))
  11. for i in filter(lambda x: \
  12.                 len(list(filter(lambda y: \
  13.                            not y in \
  14.     'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM', x))) != 0, \
  15.                 s.split()):
  16.     print(i, end = ' ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement