daily pastebin goal
72%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Include all the constants we will need
  2. from math import e, pi
  3.  
  4. # Define our input
  5. a = [1,1,1,1]
  6.  
  7. for k in range(len(a)):
  8.     tmp = 0
  9.     for n in range(len(a)):
  10.         # in python ** is the power operator
  11.         tmp += a[n] * (e ** ((complex(0,1) * 2 * pi * n * k) / len(a)))
  12.     A.append(tmp) # push_back
  13.  
  14. print A
RAW Paste Data
Top