Answer:
It gives a new string
Explanation:
In programming; when two or more strings are concatenated by a concatenating operator, the result is always a new string.
From the question, we have that
str1 = "Good
str2 = "Evening"
Let's assume that + is the concatenating operator;
str1 + str2 = "Good" + "Evening" = "GoodEvening"
The result of concatenating str1 and str2 is a new string "GoodEvening" while str1 and str2 still maintain their original string value of "Good" and "Evening"
def dx(fn, x, delta=0.001):
return (fn(x+delta) - fn(x))/delta
def solve(fn, value, x=0.5, maxtries=1000, maxerr=0.00001):
for tries in xrange(maxtries):
err = fn(x) - value
if abs(err) < maxerr:
return x
slope = dx(fn, x)
x -= err/slope
raise ValueError('no solution found')
Answer:
20
Explanation:
assuming the print statement is not indented, the program effectively calculates 2+5+6+7.
The range(...) is <em>excluding </em>the end value (8 in this case).