Skip to content

Python

Some nice tools to use for python

VSCode + Extensions

  • TODO

Other IDE

Jupyter Notebooks

Cool Stuff

Simple Webserver Python 2

python -m SimpleHTTPServer 8008

Python 3

python3 -m http.server 8009

String manipulation

Removing Duplicates from a List

L = list(set(L))

Getting Integers from a string (space seperated)

ints = [int(x) for x in S.split()]

Functions

Finding Factorial

fac=lambda(n):reduce(int.__mul__,range(1,n+1),1)

Finding greatest common divisor

def gcd(a,b):
    while(b):a,b=b,a%b
        return a
Back to top