16 lines
312 B
Python
16 lines
312 B
Python
from math import log10
|
|
|
|
def recursive_loss(n):
|
|
if(n == 1):
|
|
return 1
|
|
else:
|
|
return 2**(n - 1) + recursive_loss(n - 1)
|
|
|
|
if( __name__ == "__main__"):
|
|
|
|
print("On an 8x8 board you loose:", recursive_loss(8*8))
|
|
print("that is a number with "
|
|
, int(log10(recursive_loss(8*8) / 100))
|
|
, "zeros (in Euros)")
|
|
|