Python Forum
Getting an unexpected generator object ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting an unexpected generator object ?
#9
thank you.
I have changed line 24-25
with this code
error=(abs(trapezoidal(f,a,b,n)-c[0]) for n in range (300,900))
print(list(error))
and it works, however, I am not understanding the meaning of c[0], I just notice that if I write just 'c' I get an error. What does the 0 stand for? It looks like is the first element of a list, but c is the outcome of the integral so I am not sure what is the relationship between the integral and the list.
Reply


Messages In This Thread
RE: Getting an unexpected generator object ? - by mcgrim - Mar-27-2019, 01:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Creating list of lists from generator object t4keheart 1 2,223 Nov-13-2020, 04:59 AM
Last Post: perfringo
  unexpected object? urufu 2 2,037 Mar-08-2020, 02:35 PM
Last Post: urufu
  receive from a generator, send to a generator Skaperen 9 5,544 Feb-05-2018, 06:26 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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