```
class Solution(object):
def convert(self, s, numRows):
"""
:type s: str
:type numRows: int
:rtype: str
"""
if numRows == 1:
return s
for i in range(1, numRows+1):
row[i] = ""
l = 2*(numRows-1)
for i in range(len(s)):
if (i+1)%l <= numRows:
j = (i+1)%l
else:
j = l - (i+1)%l + 2
row[j] += s[i]
for i in range(1, numRows+1):
row += row[i]
return row
```