title: Python 3.5.1 - variable returns none
body: <p>My question is regarding some code that is part of an Udacity assignment. The following code is not returning any value. I assume that I'm not calling the "scalar" function properly from my "normalized" function. The line <code>norm = self.scalar(scale)</code> returns type none. Can someone give me a pointer?</p>
  
  <p>Code:</p>
  
  <pre><code>import math 
  from decimal import Decimal, getcontext
  
  getcontext().prec = 10
  
  class Vector(object):
      def __init__(self, coordinates):
          try:
              if not coordinates:
                  raise ValueError
              self.coordinates = tuple([Decimal(x) for x in coordinates])
              self.dimension = len(self.coordinates)
  
          except ValueError:
              raise ValueError('The coordinates must be nonempty')
  
          except TypeError:
              raise TypeError('The coordinates must be an iterable')
  
      def __eq__(self, v):
          return self.coordinates == v.coordinates
      def scalar(self, c):
          new_coordinates = [Decimal(c)*x for x in self.coordinates]
          #new_coordinates = []
          #n = len(self.coordinates)
          #for i in range(n):
          #    new_coordinates.append(self.coordinates[i] * c)
          #print(Vector(new_coordinates))
  
      def magnitude(self):
          new_sq = [x**2 for x in self.coordinates]
          new_mag = math.sqrt(sum(new_sq))
          return (new_mag)
  
      def normalized(self):
          magnitude = self.magnitude()
          scale = 1/magnitude
          print(scale)
          norm = self.scalar(scale)
          #print(type(norm))
          print(norm)
          return (norm)
  
  my_vector = Vector([1,2])  
  Vector.normalized(my_vector)
  </code></pre>