To find the absolute value of a number:
-8.32*-1 vs abs(-8.32) #saves 1 byte
If one wants to append list B at the end of A, then:
A+=[B] vs A.append(B)
If one wants to extend A using elements of B, then:
A+=B vs A.extend(B)
Increment m by n if a certain condition is true in Python
m+=(Condition)*n vs if Condition:m+=n
Returning True or False in Python
return 1>0 vs return True return 1>1 vs return False
Use += instead of append and extend
A.append(B) Refcan be shortened to:
A+=B, B, here creates a one-element tuple which can be used to extend http://ajs-handling-problems-in-pythonblog.blogspot.in/A just like [B] in A+=[B].
A.extend(B) can be shortened to:
A+=B