```
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param two ListNodes
# @return a ListNode
def mergeTwoLists(self, l1, l2):
if l1 == None:
return l2
if l2 == None:
return l1
m = 1
p1 = l1
while p1.next != None:
m += 1
p1 = p1.next
n = 1
p2 = l2
while p2.next != None:
n += 1
p2 = p2.next
p1 = l1
p2 = l2
if l1.val <= l2.val:
s = l1
p1 = p1.next
else:
s = l2
p2 = p2.next
s1 = s
for k = range(m+n-1):
if p1 == None:
s1.next = p2
return s
if p2 == None:
s1.next = p1
return s
if p1.val <= p2.val:
s1.next = p1
s1 = p1
p1 = p1.next
else:
s1.next = p2
s1 = p2
p2 = p2.next
```

When input is {}, {}, I get Runtime Error Message: Line 35: SyntaxError: invalid syntax

Line 35 is:

for k = range(m+n-1):

However, the beginning of my code is:

```
if l1 == None:
return l2
if l2 == None:
return l1
```

I think it should return None when the input is {}, {}