Re: Newline (NuBe Question)

2023-11-15 Thread Grizzy Adams via Python-list
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)

Re: Newline (NuBe Question)

2023-11-15 Thread Thomas Passin via Python-list
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 - Grizzy Adams via Python-list wrote: I don't give solutions; just a nudge... you appear not

Re: Newline (NuBe Question)

2023-11-15 Thread Grizzy Adams via Python-list
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 - 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 deline

Re: xor operator

2023-11-15 Thread Dom Grigonis via Python-list
In case someone is actually going to execute the code, there is a bug: `set` need to be wrapped in `len` for criteria args. > On 15 Nov 2023, at 20:13, Dom Grigonis wrote: > > > The specific situation was related to truth values and following out of that > my considerations regarding equivale

__set_name__ equivalent for instance

2023-11-15 Thread Dom Grigonis via Python-list
So there is a method __set_name__ which is called on class creation. The functionality that I am interested in is not retrieving name, but the fact that it also receives `owner` argument. Thus, allowing simulation of bound class method. I was wandering if there is an equivalent functionality of

Re: xor operator

2023-11-15 Thread Dom Grigonis via Python-list
The specific situation was related to truth values and following out of that my considerations regarding equivalent of all and any for counting `truths`. So one of the specific examples: class Publisher: def __init__(self): self.subscribers = dict() def subscribe(self, sub, crit

Re: Newline (NuBe Question)

2023-11-15 Thread Pierre Fortin via Python-list
On Wed, 15 Nov 2023 16:51:09 - 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', 'M

Re: xor operator

2023-11-15 Thread Peter J. Holzer via Python-list
On 2023-11-15 12:26:32 +0200, Dom Grigonis wrote: > > Thank you, > > > test2 = [True] * 100 + [False] * 2 > test2i = list(range(100)) > > %timeit len(set(test2i)) == 1 # 1.6 µs ± 63.6 ns per loop (mean ± std. dev. > of 7 runs, 1,000,000 loops each) > %timeit all(test2) # 386 ns

Re: Newline (NuBe Question)

2023-11-15 Thread Grizzy Adams via Python-list
Wednesday, November 15, 2023 at 9:45, Thomas Passin via Python-list wrote: Re: Newline (NuBe Question) (at least in part) >On 11/15/2023 2:25 AM, Grizzy Adams via Python-list wrote: >> Hi & thanks for patience with what could be simple to you >You may see responses that suggest various code alte

Re: Newline (NuBe Question)

2023-11-15 Thread Thomas Passin via Python-list
On 11/15/2023 2:25 AM, Grizzy Adams via Python-list wrote: Hi & thanks for patience with what could be simple to you Have this (from an online "classes" tutorial) --- Start Code Snippit --- students = [] grades = [] for s in geographyClass: students.append(geographyStudent(s)) for s i

Re: Newline (NuBe Question)

2023-11-15 Thread Grizzy Adams via Python-list
Wednesday, November 15, 2023 at 9:50, Alan Gauld via Python-list wrote: Re: Newline (NuBe Question) (at least in part) >On 15/11/2023 07:25, Grizzy Adams via Python-list wrote: >> for s in students: >> grades.append(s.school) >> grades.append(s.name) >>

Re: xor operator

2023-11-15 Thread Dom Grigonis via Python-list
Thank you, test2 = [True] * 100 + [False] * 2 test2i = list(range(100)) %timeit len(set(test2i)) == 1 # 1.6 µs ± 63.6 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each) %timeit all(test2) # 386 ns ± 9.58 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)

Re: Newline (NuBe Question)

2023-11-15 Thread Cameron Simpson via Python-list
On 15Nov2023 07:25, Grizzy Adams wrote: Have this (from an online "classes" tutorial) Response inline below. students = [] grades = [] for s in geographyClass: students.append(geographyStudent(s)) for s in students: grades.append(s.school) grades.append(

Re: Newline (NuBe Question)

2023-11-15 Thread Alan Gauld via Python-list
On 15/11/2023 07:25, Grizzy Adams via Python-list wrote: > for s in students: > grades.append(s.school) > grades.append(s.name) > grades.append(s.finalGrade()) > if s.finalGrade()>82: > grades.append("Pass") >

Re: Newline (NuBe Question)

2023-11-15 Thread dn via Python-list
On 15/11/2023 20.25, Grizzy Adams via Python-list wrote: Hi & thanks for patience with what could be simple to you Have this (from an online "classes" tutorial) There are lots of on-line classes! --- Start Code Snippit --- students = [] grades = [] for s in geographyClass: student