We study learnability of two important classes of mechanisms, menus of lotteries and two-part tariffs. A menu of lotteries is a list of entries where each entry is a pair consisting of probabilities of allocating each item and a price. Menus of lotteries is an especially important family of randomized mechanisms that are known to achieve revenue beyond any deterministic mechanism. A menu of two-part tariffs, on the other hand, is a pricing scheme (that consists of an up-front fee and a per unit fee) that is commonly used in the real world, e.g., for car or bike sharing services.We study learning high-revenue menus of lotteries and two-part tariffs from buyer valuation data in both distributional settings, where we have access to buyers' valuation samples up-front, and online settings, where buyers arrive one at a time and no distributional assumption is made about their values. Our main contribution is proposing the first online learning algorithms for menus of lotteries and two-part tariffs with strong regret bound guarantees. Furthermore, we provide algorithms with improved running times over prior work for the distributional settings.The key difficulty when deriving learning algorithms for these settings is that the relevant revenue functions have sharp transition boundaries. In stark contrast with the recent literature on learning such unstructured functions, we show that simple discretization-based techniques are sufficient for learning in these settings. * Some online learning algorithms, including those proved via the dispersion method, explained later, still make distributional assumptions; however, unlike the distributional learning setting, the draws are not necessarily from identical distributions.