Python Forum

Full Version: Hello!New to python!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!i am 17 years old and i started studying python in my school!
My teacher gave us some exercises and told us to find the mistakes in the code and correct them.
i have the following code:

a=1
for i in range(1.0, 10.0):
    a =* (i**2) + (i**(1/2))
print(a)
and the result to this one should be 635083338027.779

the mistakes i have found or at least i think they are the ones in the bold.

1.range takes only integers so that should be range(1,10)
2.it should be only =

am i correct for these points??
Now,when i run it the result is 84.

Can someone please explain me what changes i have to do so the result be the underline one?
can you help me?

ok buran!
i am sorry.My mistake
You are correct that there is mistake on line#3, but it's not what you think it is.
Hint:
oh my god!It was so simple???Thanks!