2.Add Two Numbers

This question is the basic operation of the linked list, that is, the value val and the successor next need to be clarified, that is, temp = temp.next in the loop, which is equivalent to sliding back once

The second one is to be familiar with python functions. For example, str() converts it into characters (you can also directly convert all a list into strings), and strings in python can be spliced ​​by '+', which is very Convenience

The other is that x[::-1] is the reverse order



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324725827&siteId=291194637