1. Python packaging with cython

    cython converts python code to C/C++ and creates compiled extensions. Generally this is used to speed up the execution, but one can also use it for protecting their python source code.

    Code structure

    +- setup.py
    +- README.md
    +- my_pkg
       +- __init__.py
       +- module_one.pyx
       +- module_two.pyx
       +- utils.pyx
    # __init__.py …
    Tagged as : python cython packaging
  2. Fizz Buzz


    Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

    f = lambda x: 'FizzBuzz' if not (x …
    Tagged as : python programming

Page 1 / 1