import color

def parse(mat_node):
    materials = []
    for node in mat_node:
        materials.append(Material(node))


class Material:
    ''' it’s a material
    '''

    def __init__(self, node):
        for c in node:
            if c.tag == 'ambient':
                self.ambient_color = color.parse(c[0])
                self.ambient_color *= float(c.attrib['factor'].replace(',', '.'))
            elif c.tag == 'diffuse':
                self.diffuse_color = color.parse(c[0])
                self.diffuse_color *= float(c.attrib['factor'].replace(',', '.'))
            elif c.tag == 'specular':
                self.specular_color = color.parse(c[0])
                self.specular_color *= float(c.attrib['factor'].replace(',', '.'))
            elif c.tag == 'reflection':
                self.reflection_color = color.parse(c[0])
                self.reflection_color *= float(c.attrib['factor'].replace(',', '.'))

import color

def parse(mat_node):
    materials = []
    for node in mat_node:
        materials.append(Material(node))


class Material:
    ''' it’s a material
    '''

    def __init__(self, node):
        for c in node:
            if c.tag == 'ambient':
                self.ambient_color = color.parse(c[0])
                self.ambient_color *= float(c.attrib['factor'])
            elif c.tag == 'diffuse':
                self.diffuse_color = color.parse(c[0])
                self.diffuse_color *= float(c.attrib['factor'])
            elif c.tag == 'specular':
                self.specular_color = color.parse(c[0])
                self.specular_color *= float(c.attrib['factor'])
            elif c.tag == 'reflection':
                self.reflection_color = color.parse(c[0])
                self.reflection_color *= float(c.attrib['factor'])

Remove replacement of commas by points
Remove replacement of commas by points

  import color
  
  def parse(mat_node):
      materials = []
      for node in mat_node:
          materials.append(Material(node))
  
  
  class Material:
      ''' it’s a material
      '''
  
      def __init__(self, node):
          for c in node:
              if c.tag == 'ambient':
                  self.ambient_color = color.parse(c[0])
-                 self.ambient_color *= float(c.attrib['factor'].replace(',', '.'))
+                 self.ambient_color *= float(c.attrib['factor'])
              elif c.tag == 'diffuse':
                  self.diffuse_color = color.parse(c[0])
-                 self.diffuse_color *= float(c.attrib['factor'].replace(',', '.'))
+                 self.diffuse_color *= float(c.attrib['factor'])
              elif c.tag == 'specular':
                  self.specular_color = color.parse(c[0])
-                 self.specular_color *= float(c.attrib['factor'].replace(',', '.'))
+                 self.specular_color *= float(c.attrib['factor'])
              elif c.tag == 'reflection':
                  self.reflection_color = color.parse(c[0])
-                 self.reflection_color *= float(c.attrib['factor'].replace(',', '.'))
+                 self.reflection_color *= float(c.attrib['factor'])
  
Remove replacement of commas by points
## Code Before:
import color

def parse(mat_node):
    materials = []
    for node in mat_node:
        materials.append(Material(node))


class Material:
    ''' it’s a material
    '''

    def __init__(self, node):
        for c in node:
            if c.tag == 'ambient':
                self.ambient_color = color.parse(c[0])
                self.ambient_color *= float(c.attrib['factor'].replace(',', '.'))
            elif c.tag == 'diffuse':
                self.diffuse_color = color.parse(c[0])
                self.diffuse_color *= float(c.attrib['factor'].replace(',', '.'))
            elif c.tag == 'specular':
                self.specular_color = color.parse(c[0])
                self.specular_color *= float(c.attrib['factor'].replace(',', '.'))
            elif c.tag == 'reflection':
                self.reflection_color = color.parse(c[0])
                self.reflection_color *= float(c.attrib['factor'].replace(',', '.'))

## Instruction:
Remove replacement of commas by points
## Code After:
import color

def parse(mat_node):
    materials = []
    for node in mat_node:
        materials.append(Material(node))


class Material:
    ''' it’s a material
    '''

    def __init__(self, node):
        for c in node:
            if c.tag == 'ambient':
                self.ambient_color = color.parse(c[0])
                self.ambient_color *= float(c.attrib['factor'])
            elif c.tag == 'diffuse':
                self.diffuse_color = color.parse(c[0])
                self.diffuse_color *= float(c.attrib['factor'])
            elif c.tag == 'specular':
                self.specular_color = color.parse(c[0])
                self.specular_color *= float(c.attrib['factor'])
            elif c.tag == 'reflection':
                self.reflection_color = color.parse(c[0])
                self.reflection_color *= float(c.attrib['factor'])
