# -*- coding: utf-8 -*- """ Created on Mon May 29 09:36:54 2017 @author: 07sta """ from numpy import * a = array([[3,8,1],[8,4,1],[2,1,4]]) print linalg.inv(a) print linalg.eig(a) import numpy as np import matplotlib.pyplot as plt x = np.linspace(0,2*np.pi,100) y = 3*np.sin(x) +np.cos(x+1) plt.plot(x,y) plt.show() def what(arg): if arg == []: return arg else: return what(arg[1:]) + [arg[0]] print what([2,3,4]) def fact(n): if n == 0 or n == 1: return 1 else: return n * fact(n-1) def rfib(n): if n == 1 or n == 2: return 1 else: return rfib(n-1) + rfib(n-2) print fact(5) print rfib(5) def fn(v,z): if (z == 0): answer = 1 else: answer = v * fn(v, z-1) return(answer) print fn(2,3)