My Take on Yandex Pre-interview Python Assignment

I’ve applied for a junior Python position at Russian internet giant Yandex
(very similar to Google). And although my application has been rejected, due to
lack of experience, I think their little pre-interview test and my take on that
may be of interest to any inquisitive pythonista. Note, that this has never
been properly translated into English before, so this is probably exclusive in
that regard.

Assignment I

There are two lists of different length. The first one contains keys, the
second - values. Write a function, that would create a dict out of these lists.
If the key doesn’t have a value - it should equal None, if the value doesn’t
have a key, it should be omitted.

Assignment II

Login should start with latin symbol, contain latin symbols, digits, dots and
hyphens, but end only with a latin symbol or a digit. Minimum length is 1
symbol, maximum - 20 symbols. Write a function that checks strings for
correspondence with these rules. Think of several methods of solving this
problem and compare them.