Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hello!New to python!
#1
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
Reply


Messages In This Thread
Hello!New to python! - by sonedap - Jan-25-2019, 08:50 AM
RE: Hello!New to python! - by buran - Jan-25-2019, 09:07 AM
RE: Hello!New to python! - by sonedap - Jan-25-2019, 09:22 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020