how to access the individual elements of a matrix in python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aboxylica
    New Member
    • Jul 2007
    • 111

    how to access the individual elements of a matrix in python

    my file is of the form

    01 "\t" 10.19 "\t" 0.00 "\t" 10.65
    02 "\t" 11.19 "\t" 10.12 "\t" 99.99


    and i need to access the individual floating point numbers from it!
    say for ex. the first no is 10.19.. i want to access this and add one to it.
    Code:
    filename=open("half.transfac","r")
    file_content=filename.readlines()
    sam=""
    for line in file_content:
        for char in line:
            if char=="\tchar\t\n":
                sam+=char
                print sam
    for char accesss every digit and not the numbers{"10.19" ,"0.00")etc. . how do i do this..help
  • dshimer
    Recognized Expert New Member
    • Dec 2006
    • 136

    #2
    There are powerful ways to do this all in one line, but by way of explanation, start by using split() to separate each line into individual data lists for further manipulation.

    Code:
    >>> for line in file_content:
    ... 	line.split()
    ... 
    ['01', '10.19', '0.00', '10.65']
    ['02', '11.19', '10.12', '99.99']
    Each of which could be appended to an empty list, forming a multi-dimensional data set. Note that all the elements are strings and would have to be converted to numbers before the math.
    Code:
    >>> datalist=[]
    >>> for line in file_content:
    ... 	datalist.append(line.split())
    ... 
    >>> datalist
    [['01', '10.19', '0.00', '10.65'], ['02', '11.19', '10.12', '99.99']]
    >>> int(datalist[0][0])
    1
    >>> float(datalist[0][1])
    10.19

    Originally posted by aboxylica
    my file is of the form

    01 "\t" 10.19 "\t" 0.00 "\t" 10.65
    02 "\t" 11.19 "\t" 10.12 "\t" 99.99


    and i need to access the individual floating point numbers from it!
    say for ex. the first no is 10.19.. i want to access this and add one to it.
    Code:
    filename=open("half.transfac","r")
    file_content=filename.readlines()
    sam=""
    for line in file_content:
        for char in line:
            if char=="\tchar\t\n":
                sam+=char
                print sam
    for char accesss every digit and not the numbers{"10.19" ,"0.00")etc. . how do i do this..help

    Comment

    • bvdet
      Recognized Expert Specialist
      • Oct 2006
      • 2851

      #3
      Originally posted by aboxylica
      my file is of the form

      01 "\t" 10.19 "\t" 0.00 "\t" 10.65
      02 "\t" 11.19 "\t" 10.12 "\t" 99.99


      and i need to access the individual floating point numbers from it!
      say for ex. the first no is 10.19.. i want to access this and add one to it.
      Code:
      filename=open("half.transfac","r")
      file_content=filename.readlines()
      sam=""
      for line in file_content:
          for char in line:
              if char=="\tchar\t\n":
                  sam+=char
                  print sam
      for char accesss every digit and not the numbers{"10.19" ,"0.00")etc. . how do i do this..help
      Here is another way to access the numbers from a dictionary:[code=Python]>>> lineList = open(file_name) .readlines()
      >>> dataDict = {}
      >>> for line in lineList:
      ... line = line.split()
      ... dataDict[line[0]] = [float(r) for r in line[1:]]
      ...
      >>> dataDict
      {'02': [11.19, 10.119999999999 999, 99.989999999999 995], '01': [10.19, 0.0, 10.65]}
      >>> dataDict['01'][0]
      10.19
      >>> dataDict['02'][2]
      99.989999999999 995[/code]You can perform mathematical operations on elements of the dictionary:[code=Python]>>> dataDict
      {'02': [11.19, 10.119999999999 999, 99.989999999999 995], '01': [10.19, 0.0, 10.65]}
      >>> dataDict['01'][0] += 1
      >>> dataDict
      {'02': [11.19, 10.119999999999 999, 99.989999999999 995], '01': [11.19, 0.0, 10.65]}
      >>> [/code]To access individual characters:[code=Python]>>> for key in dataDict:
      ... for item in dataDict[key]:
      ... print ' '.join([ch for ch in '%0.2f' % item])
      ...
      1 1 . 1 9
      1 0 . 1 2
      9 9 . 9 9
      1 0 . 1 9
      0 . 0 0
      1 0 . 6 5[/code]OR[code=Python]>>> [ch for ch in '%0.2f' % dataDict['01'][0]]
      ['1', '1', '.', '1', '9'][/code]

      Comment

      • aboxylica
        New Member
        • Jul 2007
        • 111

        #4
        i have a problem!!with a matrix type file

        THis is my file! AS u can see the first column gives the position,the second third ..etc are the part of the matrix.my problem here is that.I have to write a code to access the individual values.like if i say A[01] i should have the value 0.00 or say A[06] i should have a value 3.46. or C[04]=3.67 etc. and i have to add one to each of these elements.can you gimme the code. my code is not working.

        NA bap

        PO A C G T

        01 0.00 3.67 0.00 0.00

        02 0.00 0.00 3.67 0.00

        03 0.00 0.00 0.00 3.67

        04 0.00 3.67 0.00 0.00

        05 3.67 0.00 0.00 0.00

        06 3.46 0.00 0.22 0.00

        07 0.00 0.00 3.67 0.00

        08 0.00 0.00 0.00 3.67

        09 0.00 0.00 0.00 3.67

        10 0.00 3.67 0.00 0.00

        11 3.67 0.00 0.00 0.00

        12 3.67 0.00 0.00 0.00

        13 0.00 0.00 3.67 0.00

        14 0.00 0.00 0.00 3.67

        15 0.00 0.00 3.67 0.00

        16 0.00 3.67 0.00 0.00

        //

        //

        NA bcd

        Comment

        • bartonc
          Recognized Expert Expert
          • Sep 2006
          • 6478

          #5
          Files operate much like lists, so I alway practice with a list, then go to a file:
          Here's one way to look at such data in python:[CODE=python]rawdata = \
          ['01 0.00 3.67 0.00 0.00',

          '02 0.00 0.00 3.67 0.00',

          '03 0.00 0.00 0.00 3.67',

          '04 0.00 3.67 0.00 0.00',

          '05 3.67 0.00 0.00 0.00',

          '06 3.46 0.00 0.22 0.00',

          '07 0.00 0.00 3.67 0.00',

          '08 0.00 0.00 0.00 3.67',

          '09 0.00 0.00 0.00 3.67',

          '10 0.00 3.67 0.00 0.00',

          '11 3.67 0.00 0.00 0.00',

          '12 3.67 0.00 0.00 0.00',

          '13 0.00 0.00 3.67 0.00',

          '14 0.00 0.00 0.00 3.67',

          '15 0.00 0.00 3.67 0.00']

          datadictionary = {} # usually shorten the name to dd

          for line in rawdata:
          items = line.split()
          key = items[0]
          datadictionary[key] = [float(item) for item in items[1:]]

          print datadictionary['09'][3][/CODE]

          Comment

          • bartonc
            Recognized Expert Expert
            • Sep 2006
            • 6478

            #6
            <Moderator NOTE: Merged threads by OP on a single topic (after posting to the second)>

            Comment

            • aboxylica
              New Member
              • Jul 2007
              • 111

              #7
              i have to consider the columns also:
              like..this is my file
              A T G C
              01 1.00 2.00 3.00 4.00
              02 2.00 3.00 4.00 5.00

              now if i say A[01] i should have a value 1.00 or C[01]=4.00
              those column names A,T,G,C. i am not able to format my query file properly hope it is understood













              Originally posted by bartonc
              Files operate much like lists, so I alway practice with a list, then go to a file:
              Here's one way to look at such data in python:[CODE=python]rawdata = \
              ['01 0.00 3.67 0.00 0.00',

              '02 0.00 0.00 3.67 0.00',

              '03 0.00 0.00 0.00 3.67',

              '04 0.00 3.67 0.00 0.00',

              '05 3.67 0.00 0.00 0.00',

              '06 3.46 0.00 0.22 0.00',

              '07 0.00 0.00 3.67 0.00',

              '08 0.00 0.00 0.00 3.67',

              '09 0.00 0.00 0.00 3.67',

              '10 0.00 3.67 0.00 0.00',

              '11 3.67 0.00 0.00 0.00',

              '12 3.67 0.00 0.00 0.00',

              '13 0.00 0.00 3.67 0.00',

              '14 0.00 0.00 0.00 3.67',

              '15 0.00 0.00 3.67 0.00']

              datadictionary = {} # usually shorten the name to dd

              for line in rawdata:
              items = line.split()
              key = items[0]
              datadictionary[key] = [float(item) for item in items[1:]]

              print datadictionary['09'][3][/CODE]

              Comment

              • bartonc
                Recognized Expert Expert
                • Sep 2006
                • 6478

                #8
                Originally posted by aboxylica
                i have to consider the columns also:
                like..this is my file
                A T G C
                01 1.00 2.00 3.00 4.00
                02 2.00 3.00 4.00 5.00

                now if i say A[01] i should have a value 1.00 or C[01]=4.00
                those column names A,T,G,C. i am not able to format my query file properly hope it is understood
                I hope you understand that you should be thinking "row 0n, column X, not the other way around. Rows enclose columns, so that is the first index that you deal with.
                [CODE=python]A = 0; T = 1; G = 2; C = 3
                rawdata = \
                ['01 0.00 3.67 0.00 0.00',

                '02 0.00 0.00 3.67 0.00',

                '03 0.00 0.00 0.00 3.67',

                '04 0.00 3.67 0.00 0.00',

                '05 3.67 0.00 0.00 0.00',

                '06 3.46 0.00 0.22 0.00',

                '07 0.00 0.00 3.67 0.00',

                '08 0.00 0.00 0.00 3.67',

                '09 0.00 0.00 0.00 3.67',

                '10 0.00 3.67 0.00 0.00',

                '11 3.67 0.00 0.00 0.00',

                '12 3.67 0.00 0.00 0.00',

                '13 0.00 0.00 3.67 0.00',

                '14 0.00 0.00 0.00 3.67',

                '15 0.00 0.00 3.67 0.00']

                datadictionary = {} # usually shorten the name to dd

                for line in rawdata:
                items = line.split()
                key = items[0]
                datadictionary[key] = [float(item) for item in items[1:]]

                print datadictionary['09'][C][/CODE]

                Comment

                • bvdet
                  Recognized Expert Specialist
                  • Oct 2006
                  • 2851

                  #9
                  Originally posted by aboxylica
                  THis is my file! AS u can see the first column gives the position,the second third ..etc are the part of the matrix.my problem here is that.I have to write a code to access the individual values.like if i say A[01] i should have the value 0.00 or say A[06] i should have a value 3.46. or C[04]=3.67 etc. and i have to add one to each of these elements.can you gimme the code. my code is not working.

                  NA bap

                  PO A C G T

                  01 0.00 3.67 0.00 0.00

                  02 0.00 0.00 3.67 0.00

                  03 0.00 0.00 0.00 3.67

                  04 0.00 3.67 0.00 0.00

                  05 3.67 0.00 0.00 0.00

                  06 3.46 0.00 0.22 0.00

                  07 0.00 0.00 3.67 0.00

                  08 0.00 0.00 0.00 3.67

                  09 0.00 0.00 0.00 3.67

                  10 0.00 3.67 0.00 0.00

                  11 3.67 0.00 0.00 0.00

                  12 3.67 0.00 0.00 0.00

                  13 0.00 0.00 3.67 0.00

                  14 0.00 0.00 0.00 3.67

                  15 0.00 0.00 3.67 0.00

                  16 0.00 3.67 0.00 0.00

                  //

                  //

                  NA bcd
                  For simplicity, let us assume the data file looks like this:

                  PO A C G T
                  01 0.00 3.67 0.00 0.00
                  02 0.00 0.00 3.67 0.00
                  03 0.00 0.00 0.00 3.67
                  04 0.00 3.67 0.00 0.00
                  05 3.67 0.00 0.00 0.00
                  06 3.46 0.00 0.22 0.00
                  07 0.00 0.00 3.67 0.00
                  08 0.00 0.00 0.00 3.67
                  09 0.00 0.00 0.00 3.67
                  10 0.00 3.67 0.00 0.00
                  11 3.67 0.00 0.00 0.00
                  12 3.67 0.00 0.00 0.00
                  13 0.00 0.00 3.67 0.00
                  14 0.00 0.00 0.00 3.67
                  15 0.00 0.00 3.67 0.00
                  16 0.00 3.67 0.00 0.00

                  Create a dictionary of dictionaries:[code=Python]fn = r'H:\TEMP\temsy s\data7.txt'
                  lineList = [line.strip().sp lit() for line in open(fn).readli nes() if line != '\n']

                  headerList = lineList.pop(0)[1:]

                  # Key list
                  keys = [i[0] for i in lineList]
                  # Values list
                  values = [[float(s) for s in item] for item in [j[1:] for j in lineList]]

                  # Create a dictionary from keys and values
                  lineDict = dict(zip(keys, values))

                  dataDict = {}

                  for i, item in enumerate(heade rList):
                  dataDict[item] = {}
                  for key in lineDict:
                  dataDict[item][key] = lineDict[key][i][/code]
                  [code=Python]>>> dataDict['A']['05']
                  3.6699999999999 999
                  >>> globals().updat e(dataDict)
                  >>> A['05']
                  3.6699999999999 999
                  >>> [/code]

                  Comment

                  • aboxylica
                    New Member
                    • Jul 2007
                    • 111

                    #10
                    hey,
                    I don really understand what this line does.can u please explain?
                    values = [[float(s) for s in item] for item in [j[1:] for j in lineList]]
                    and

                    for i, item in enumerate(heade rList):
                    dataDict[item] = {}
                    for key in lineDict:
                    dataDict[item][key] = lineDict[key]
                    I dont understand this either.
                    for this code,I am getting an error which says
                    value error:invalid literal for float():A



                    Originally posted by bvdet
                    For simplicity, let us assume the data file looks like this:

                    PO A C G T
                    01 0.00 3.67 0.00 0.00
                    02 0.00 0.00 3.67 0.00
                    03 0.00 0.00 0.00 3.67
                    04 0.00 3.67 0.00 0.00
                    05 3.67 0.00 0.00 0.00
                    06 3.46 0.00 0.22 0.00
                    07 0.00 0.00 3.67 0.00
                    08 0.00 0.00 0.00 3.67
                    09 0.00 0.00 0.00 3.67
                    10 0.00 3.67 0.00 0.00
                    11 3.67 0.00 0.00 0.00
                    12 3.67 0.00 0.00 0.00
                    13 0.00 0.00 3.67 0.00
                    14 0.00 0.00 0.00 3.67
                    15 0.00 0.00 3.67 0.00
                    16 0.00 3.67 0.00 0.00

                    Create a dictionary of dictionaries:[code=Python]fn = r'H:\TEMP\temsy s\data7.txt'
                    lineList = [line.strip().sp lit() for line in open(fn).readli nes() if line != '\n']

                    headerList = lineList.pop(0)[1:]

                    # Key list
                    keys = [i[0] for i in lineList]
                    # Values list
                    values = [[float(s) for s in item] for item in [j[1:] for j in lineList]]

                    # Create a dictionary from keys and values
                    lineDict = dict(zip(keys, values))

                    dataDict = {}

                    for i, item in enumerate(heade rList):
                    dataDict[item] = {}
                    for key in lineDict:
                    dataDict[item][key] = lineDict[key][i][/code]
                    [code=Python]>>> dataDict['A']['05']
                    3.6699999999999 999
                    >>> globals().updat e(dataDict)
                    >>> A['05']
                    3.6699999999999 999
                    >>> [/code]

                    Comment

                    • bvdet
                      Recognized Expert Specialist
                      • Oct 2006
                      • 2851

                      #11
                      Originally posted by aboxylica
                      hey,
                      I don really understand what this line does.can u please explain?
                      values = [[float(s) for s in item] for item in [j[1:] for j in lineList]]
                      and

                      for i, item in enumerate(heade rList):
                      dataDict[item] = {}
                      for key in lineDict:
                      dataDict[item][key] = lineDict[key]
                      I dont understand this either.
                      for this code,I am getting an error which says
                      value error:invalid literal for float():A
                      The first question - The code is a list comprehension. Another way to write it would be:[code=Python]values = []
                      for line in lineList:
                      line = line[1:]
                      tem = []
                      for item in line:
                      tem.append(floa t(item))
                      values.append(t em)[/code]The result:[code=Python]>>> [[0.0, 3.6699999999999 999, 0.0, 0.0], [0.0, 0.0, 3.6699999999999 999, 0.0], [0.0, 0.0, 0.0, 3.6699999999999 999], [0.0, 3.6699999999999 999, 0.0, 0.0], [3.6699999999999 999, 0.0, 0.0, 0.0], [3.46, 0.0, 0.22, 0.0], [0.0, 0.0, 3.6699999999999 999, 0.0], [0.0, 0.0, 0.0, 3.6699999999999 999], [0.0, 0.0, 0.0, 3.6699999999999 999], [0.0, 3.6699999999999 999, 0.0, 0.0], [3.6699999999999 999, 0.0, 0.0, 0.0], [3.6699999999999 999, 0.0, 0.0, 0.0], [0.0, 0.0, 3.6699999999999 999, 0.0], [0.0, 0.0, 0.0, 3.6699999999999 999], [0.0, 0.0, 3.6699999999999 999, 0.0], [0.0, 3.6699999999999 999, 0.0, 0.0]][/code]

                      Comment

                      • bvdet
                        Recognized Expert Specialist
                        • Oct 2006
                        • 2851

                        #12
                        Originally posted by aboxylica
                        hey,
                        I don really understand what this line does.can u please explain?
                        values = [[float(s) for s in item] for item in [j[1:] for j in lineList]]
                        and

                        for i, item in enumerate(heade rList):
                        dataDict[item] = {}
                        for key in lineDict:
                        dataDict[item][key] = lineDict[key]
                        I dont understand this either.
                        for this code,I am getting an error which says
                        value error:invalid literal for float():A
                        The second question - This is 'headerList':[code=Python]>>> headerList
                        ['A', 'C', 'G', 'T']
                        >>> [/code]The values in 'headerList' will be 'keys' in 'dataDict'. 'dataDict' will be the main dictionary, and the values will be subdictionaries . A dictionary key is associated with a value - in this case the value will be another dictionary. Variable 'keys' contain the subdictionary keys:[code=Python]>>> keys
                        ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16']
                        >>> [/code]'lineDict' is a temporary dictionary created to make it easier to compile the data in the form you wanted:[code=Python]>>> lineDict
                        {'02': [0.0, 0.0, 3.6699999999999 999, 0.0], '03': [0.0, 0.0, 0.0, 3.6699999999999 999], '13': [0.0, 0.0, 3.6699999999999 999, 0.0], '01': [0.0, 3.6699999999999 999, 0.0, 0.0], '06': [3.46, 0.0, 0.22, 0.0], '07': [0.0, 0.0, 3.6699999999999 999, 0.0], '04': [0.0, 3.6699999999999 999, 0.0, 0.0], '05': [3.6699999999999 999, 0.0, 0.0, 0.0], '08': [0.0, 0.0, 0.0, 3.6699999999999 999], '09': [0.0, 0.0, 0.0, 3.6699999999999 999], '16': [0.0, 3.6699999999999 999, 0.0, 0.0], '12': [3.6699999999999 999, 0.0, 0.0, 0.0], '14': [0.0, 0.0, 0.0, 3.6699999999999 999], '11': [3.6699999999999 999, 0.0, 0.0, 0.0], '15': [0.0, 0.0, 3.6699999999999 999, 0.0], '10': [0.0, 3.6699999999999 999, 0.0, 0.0]}
                        >>> [/code]Using 'enumerate' on 'headerList', Python gives me these values:[code=Python]>>> for i, item in enumerate(heade rList):
                        ... print i, item
                        ...
                        0 A
                        1 C
                        2 G
                        3 T
                        >>> [/code]Here's an interactive example showing what is happening inside the nested for loop:[code=Python]>>> dataDict
                        {}
                        >>> key
                        '10'
                        >>> item
                        'T'
                        >>> lineDict
                        {'02': [0.0, 0.0, 3.6699999999999 999, 0.0], '03': [0.0, 0.0, 0.0, 3.6699999999999 999], '13': [0.0, 0.0, 3.6699999999999 999, 0.0], '01': [0.0, 3.6699999999999 999, 0.0, 0.0], '06': [3.46, 0.0, 0.22, 0.0], '07': [0.0, 0.0, 3.6699999999999 999, 0.0], '04': [0.0, 3.6699999999999 999, 0.0, 0.0], '05': [3.6699999999999 999, 0.0, 0.0, 0.0], '08': [0.0, 0.0, 0.0, 3.6699999999999 999], '09': [0.0, 0.0, 0.0, 3.6699999999999 999], '16': [0.0, 3.6699999999999 999, 0.0, 0.0], '12': [3.6699999999999 999, 0.0, 0.0, 0.0], '14': [0.0, 0.0, 0.0, 3.6699999999999 999], '11': [3.6699999999999 999, 0.0, 0.0, 0.0], '15': [0.0, 0.0, 3.6699999999999 999, 0.0], '10': [0.0, 3.6699999999999 999, 0.0, 0.0]}
                        >>> lineDict[key][3]
                        0.0
                        >>> dataDict[item] = {}
                        >>> dataDict[item][key] = lineDict[key][2]
                        >>> dataDict
                        {'T': {'10': 0.0}}
                        >>> [/code]I hope this helps you understand what is happening.

                        Comment

                        • bvdet
                          Recognized Expert Specialist
                          • Oct 2006
                          • 2851

                          #13
                          Originally posted by aboxylica
                          for this code,I am getting an error which says
                          value error:invalid literal for float():A
                          Check variable 'lineList'. It should look like this:[code=Python]>>> for line in lineList:
                          ... print line
                          ...
                          ['01', '0.00', '3.67', '0.00', '0.00']
                          ['02', '0.00', '0.00', '3.67', '0.00']
                          ['03', '0.00', '0.00', '0.00', '3.67']
                          ['04', '0.00', '3.67', '0.00', '0.00']
                          ['05', '3.67', '0.00', '0.00', '0.00']
                          ['06', '3.46', '0.00', '0.22', '0.00']
                          ['07', '0.00', '0.00', '3.67', '0.00']
                          ['08', '0.00', '0.00', '0.00', '3.67']
                          ['09', '0.00', '0.00', '0.00', '3.67']
                          ['10', '0.00', '3.67', '0.00', '0.00']
                          ['11', '3.67', '0.00', '0.00', '0.00']
                          ['12', '3.67', '0.00', '0.00', '0.00']
                          ['13', '0.00', '0.00', '3.67', '0.00']
                          ['14', '0.00', '0.00', '0.00', '3.67']
                          ['15', '0.00', '0.00', '3.67', '0.00']
                          ['16', '0.00', '3.67', '0.00', '0.00']
                          >>> [/code]

                          Comment

                          • aboxylica
                            New Member
                            • Jul 2007
                            • 111

                            #14
                            The header list is supposed to take the first four letters right? like A,T,G,C.it is not happening
                            and my linelist has the entire file(I mean with the A,T,G,C)

                            Originally posted by bvdet
                            Check variable 'lineList'. It should look like this:[code=Python]>>> for line in lineList:
                            ... print line
                            ...
                            ['01', '0.00', '3.67', '0.00', '0.00']
                            ['02', '0.00', '0.00', '3.67', '0.00']
                            ['03', '0.00', '0.00', '0.00', '3.67']
                            ['04', '0.00', '3.67', '0.00', '0.00']
                            ['05', '3.67', '0.00', '0.00', '0.00']
                            ['06', '3.46', '0.00', '0.22', '0.00']
                            ['07', '0.00', '0.00', '3.67', '0.00']
                            ['08', '0.00', '0.00', '0.00', '3.67']
                            ['09', '0.00', '0.00', '0.00', '3.67']
                            ['10', '0.00', '3.67', '0.00', '0.00']
                            ['11', '3.67', '0.00', '0.00', '0.00']
                            ['12', '3.67', '0.00', '0.00', '0.00']
                            ['13', '0.00', '0.00', '3.67', '0.00']
                            ['14', '0.00', '0.00', '0.00', '3.67']
                            ['15', '0.00', '0.00', '3.67', '0.00']
                            ['16', '0.00', '3.67', '0.00', '0.00']
                            >>> [/code]

                            Comment

                            • aboxylica
                              New Member
                              • Jul 2007
                              • 111

                              #15
                              fn = 'half.txt'
                              fn_=open("half. txt","r")
                              file_content=fn _.readlines()

                              for line in file_content:
                              linelist=line.s trip().split()
                              print linelist

                              headerList = linelist.pop(0)[1:]
                              print headerList

                              when i do this my code has a headerlist which has
                              0
                              1
                              2
                              3
                              4
                              5
                              6
                              7
                              8
                              9
                              0
                              1
                              2
                              3
                              4
                              5
                              6
                              WHY IS THIS HAppening?
                              and what does the strip( ) do?

                              Comment

                              Working...