s = "hello chaps!"
with open('file.xml','w') as file: file.write(s)
integer = 10
"{0:b}".format(integer)
[chr(n) for n in range(97,110)]
def fibSeries(length, fibNumM=1, fibNumN=0, fibList=[0]):
return fibList if length <= 1 else fibSeries(length-1, fibNumM=fibNumM+fibNumN, fibNumN=fibNumM, fibList=[fibNumM+fibNumN]+fibList)
>>> fibSeries(10)
[55, 34, 21, 13, 8, 5, 3, 2, 1, 0]
For a function defined as:
f(N) = Op(N-1, N-2)
Recur like:
def f(.., M, N, ...):
return ... if ... else f(.., M=Op(M, N), N=M, ...)