title: Can I use a class variable in python similarly to how a struct variable in C is used?
body: <p>I wrote a program in C that uses structs to model the motion of planets going around the Sun.  I want to write that same program in Python.  The planets and Sun are treated as particles.</p>
  
  <p>In C I wrote a struct for the data of any particle.  In the 2D arrays, the rows are the x,y,z components and the columns are the old,current,new iterations.  The acceleration of each particle doesn't change so it is an array of x,y,z components. </p>
  
  <pre><code>struct type_particle {
      double mass;
      double acceleration[3];
      double position[3][3];
      double velocity[3][3];
  };
  </code></pre>
  
  <p>I used this struct variable to access data about specific particles.  Each element in the array is a specific particle where N=9.  For example, particle[0] is the Sun.</p>
  
  <pre><code>static struct type_particle particle[N];
  </code></pre>
  
  <p>I define the initial x-position of the Sun by</p>
  
  <pre><code>particle[0].position[0][0] = -0.002893107099833329;   
  </code></pre>
  
  <p>I want to do the same thing in Python using classes.  I am just using the Sun and one planet so N=2.  So far I have this.     </p>
  
  <pre><code>class type_particle:
      particle = [N]
      def __init__(self, position):
          self.position = [],[]
  </code></pre>
  
  <p>I am not sure if I can define the class variable "particle" as a list.  Is this on the right track to creating something that gives the same results as the struct and struct variable I used earlier?  I read that classes can be used like structs but I do not understand how.  My goal is to use a class to access data for a particular particle.  Any help is appreciated.</p>