Wednesday, November 15, 2023 at 15:54, Thomas Passin via Python-list wrote: Re: Newline (NuBe Question) (at least in part)
>On 11/15/2023 2:04 PM, Grizzy Adams via Python-list wrote: >> Wednesday, November 15, 2023 at 12:19, Pierre Fortin wrote: >> Re: Newline (NuBe Question) (at least in part) >>> On Wed, 15 Nov 2023 16:51:09 -0000 Grizzy Adams via Python-list wrote: >>> I don't give solutions; just a nudge... you appear not to fully grok >>> "list"; your list is ONE list with no delineation between students. You >>> want a "list of lists"... >>>> ['Example High', 'Mary', 89.6, 'Pass', 'Example High', 'Matthew', 76.5, >>>> 'Fail', 'Example High', 'Marie', 80.4, 'Fail', 'Example High', 'Manuel', >>>> 79.6, 'Fail', 'Example High', 'Malala', 98.9, 'Pass'] >>> Like this: >>> students = [ >>> ['Example High', 'Mary', 89.6, 'Pass'], >>> ['Example High','Matthew', 76.5, 'Fail'], >>> ['Example High', 'Marie', 80.4, 'Fail'], >>> ['Example High', 'Manuel', 79.6, 'Fail'], >>> ['Example High', 'Malala', 98.9, 'Pass'] >>> ] >> for now I made a copt of code and altered to >> >> students = [] >> grades = [] ># In this design there is no point in the extra loop. ># also, the indentation is wrong. Perhaps you inserted ># tabs? Use only spaces in these posts. I copy-pasted the code direct from IDLE, (to avoid any other typo's) ># Also you don't need the students list >> for student in geographyClass: >> # students.append(geographyStudent(s)) > s = geographyStudent(student) >> > # for s in students: >> if s.finalGrade()>82: Result=("Pass") >> else: Result=("Fail") >> print(s.school, s.name, s.finalGrade(),Result) I'll hive this a try (as a learning point) Thanks -- https://mail.python.org/mailman/listinfo/python-list