This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def oneliner(data, part=1): | |
return sum([len(set(a for p in g.split() for a in p)) for g in data]) if part == 1 else sum([len(set(list([chr(97+i) for i in range(26)])).intersection(*[set(a for a in p) for p in g.split()])) for g in data]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import string | |
def generate_password( | |
password_length: int = 8, | |
has_symbols: bool = False, | |
has_uppercase: bool = False, | |
ignored_chars: list = None, | |
allowed_chars: list = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Special for the SoftUni python group | |
# Python 3.5 / 3.6 required | |
# fbchat required | |
from fbchat import Client | |
from fbchat.models import * | |
from getpass import getpass | |
client = Client('anyemail@gmail.com', getpass()) | |
users = client.fetchAllUsers() |