human
Sum of the series 2 ^ 0 + 2 ^ 1 + 2 ^ 2 + ... . . + 2 ^ n | function to calculate sum of series.
initialize sum to 0.
loop to calculate sum of series.
calculate 2 ^ i.
Driver code"
Solution in Python:
assistant
#Here is code to sum of the series 2 ^ 0 + 2 ^ 1 + 2 ^ 2 + .
 def calculateSum ( n ) :
	sum = 0
	for i in range ( 0 , n ) :
		sum = sum + ( 1 << i )
	return sum
n = 10
print ( " Sum ▁ of ▁ series ▁ " , calculateSum ( n ) )