the doc of dictionary said "if a tuple contains any mutable object either
directly or indirectly, it cannot be used as a key."
i think a instance of user-defined class is mutable, but i found it can be
placed into a tuple that as a key of a dict:
>>> class mycls(object):
... a = 1
I have created a program in Python
Is my Program Artificial Intelligent ?
In this I train the program to answer my question
Eg 1:
Training
0,0,0,1 > Ans is 0
0,0,1,0--> Ans is 1
0,1,1,0--> Ans is 1
You can observe ans is 3rd Element
Testing
0,0,1,0 --> Ans ?
It gives 1
Eg 2
On 06/08/2020 05:17, ZHAOWANCHENG wrote:
the doc of dictionary said "if a tuple contains any mutable object either directly
or indirectly, it cannot be used as a key."
i think a instance of user-defined class is mutable, but i found it can be
placed into a tuple that as a key of a dict:
>>
On 8/6/20 12:17 AM, ZHAOWANCHENG wrote:
> the doc of dictionary said "if a tuple contains any mutable object either
> directly or indirectly, it cannot be used as a key."
> i think a instance of user-defined class is mutable, but i found it can be
> placed into a tuple that as a key of a dict:
>
Python is my favorite language and the easiest to use in my opinion.
Lisp has a far simpler grammar and syntax. A beginner I think could
learn Lisp much faster than Python.
Therefore, it seems like Lisp *should* be easier to work with and more
readable. I don't feel like it is easier to use b
On 8/6/20 7:40 AM, Robin Becker wrote:
On 06/08/2020 05:17, ZHAOWANCHENG wrote:
So are instances of user-defined classes mutable or immutable?
user class instances are clearly mutable, and in my python 3.8 you can
do horrid things like this
>
> [snip buggy/incorrect uses of __hash__]
You
On 8/6/20 10:40 AM, Robin Becker wrote:
> On 06/08/2020 05:17, ZHAOWANCHENG wrote:
>> the doc of dictionary said "if a tuple contains any mutable object
>> either directly or indirectly, it cannot be used as a key."
>> i think a instance of user-defined class is mutable, but i found it
>> can be pl
On Thu, Aug 06, 2020 at 12:17:17PM +0800, ZHAOWANCHENG wrote:
> the doc of dictionary said "if a tuple contains any mutable object either
> directly or indirectly, it cannot be used as a key."
> i think a instance of user-defined class is mutable, but i found it can be
> placed into a tuple that
On Fri, Aug 7, 2020 at 1:16 AM Christian Seberino wrote:
>
> Python is my favorite language and the easiest to use in my opinion.
>
> Lisp has a far simpler grammar and syntax. A beginner I think could
> learn Lisp much faster than Python.
>
> Therefore, it seems like Lisp *should* be easier to
This is probably more ML then AI.
On Thu, Aug 6, 2020, 7:57 PM wrote:
> I have created a program in Python
>
> Is my Program Artificial Intelligent ?
>
> In this I train the program to answer my question
> Eg 1:
>
> Training
> 0,0,0,1 > Ans is 0
> 0,0,1,0--> Ans is 1
> 0,1,1,0--> Ans
On Thursday, August 6, 2020 at 10:52:00 AM UTC-5, Chris Angelico wrote:
> The point of learning a
> language isn't that you can take a piece of pre-existing code and
> figure out what it'll do, step by step; the point is to be able to
> encode your intentions in that language, and to read the code
Hmmm... Rename genes, fix Excel, or dump Excel in favor of Python? I know
what my choice would have been. :-)
https://www.theverge.com/2020/8/6/21355674/human-genes-rename-microsoft-excel-misreading-dates
Skip
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Aug 7, 2020 at 2:36 AM Christian Seberino wrote:
>
> On Thursday, August 6, 2020 at 10:52:00 AM UTC-5, Chris Angelico wrote:
> > The point of learning a
> > language isn't that you can take a piece of pre-existing code and
> > figure out what it'll do, step by step; the point is to be able
Christian Seberino writes:
> Python is my favorite language and the easiest to use in my opinion.
>
> Lisp has a far simpler grammar and syntax. A beginner I think could
> learn Lisp much faster than Python.
>
> Therefore, it seems like Lisp *should* be easier to work with and more
> readable.
On 2020-08-07 at 04:00:34 +1000,
Regarding "Re: How explain why Python is easier/nicer than Lisp which has a
simpler grammar/syntax?,"
Chris Angelico wrote:
> On Fri, Aug 7, 2020 at 2:36 AM Christian Seberino wrote:
> >
> > On Thursday, August 6, 2020 at 10:52:00 AM UTC-5, Chris Angelico wrote:
On Fri, Aug 7, 2020 at 5:10 AM <2qdxy4rzwzuui...@potatochowder.com> wrote:
>
> I would say that expressiveness is how *directly* you can translate your
> ideas into code, and how *directly* some one else can see your original
> idea by reading your code.
Yep, how directly or how accurately.
> So
On 2020-08-07 at 05:22:53 +1000,
Chris Angelico wrote:
> On Fri, Aug 7, 2020 at 5:10 AM <2qdxy4rzwzuui...@potatochowder.com> wrote:
> One thing worth noting is that your mental pseudo-code is affected by
> the languages you're comfortable with. You said:
>
> > create a new list in which each va
On 8/6/20 4:07 PM, 2qdxy4rzwzuui...@potatochowder.com wrote:
> for (index, value) in enumerate(this_list):
> this_list[index] = 2 * value
>
> Or:
>
> for index in range(len(this_list)):
> this_list[index] *= 2
>
> (But I tend to avoid that, though, because I can never rememb
On 07/08/2020 05:33, Skip Montanaro wrote:
Hmmm... Rename genes, fix Excel, or dump Excel in favor of Python? I know
what my choice would have been. :-)
https://www.theverge.com/2020/8/6/21355674/human-genes-rename-microsoft-excel-misreading-dates
At the risk of screaming off-topic...
The ar
On 07Aug2020 09:40, DL Neil wrote:
>On 07/08/2020 05:33, Skip Montanaro wrote:
>>Hmmm... Rename genes, fix Excel, or dump Excel in favor of Python? I know
>>what my choice would have been. :-)
>>
>>https://www.theverge.com/2020/8/6/21355674/human-genes-rename-microsoft-excel-misreading-dates
>
>
>
> Trying to maintain that recursive list of unclosed lists in your
> brain is fun. It stretches the brain in interesting ways. I was
> way into Lisp at one point, including writing several Lisp
> interpreters (that simple structure makes Lisp very easy to
> implement). But I never found Lisp code v
>
> When Excel reads a file, it looks for stuff and decides to upgrade its
> type. Eg dates etc (particularly pernicious with US-style dates versus
> the rest of the planet). Mojibake for data ensues.
>
> As always, I am reminded of Heuer's Razor:
>
> If it can't be turned off, it's not a feat
On Thu, Aug 06, 2020 at 07:19:01PM -0500, Skip Montanaro wrote:
> >
> > When Excel reads a file, it looks for stuff and decides to upgrade its
> > type. Eg dates etc (particularly pernicious with US-style dates versus
> > the rest of the planet). Mojibake for data ensues.
> >
> > As always, I am r
On Thu, Aug 06, 2020 at 04:08:29PM -0700, Christian Seberino wrote:
> > Trying to maintain that recursive list of unclosed lists in your
> > brain is fun. It stretches the brain in interesting ways. I was
> > way into Lisp at one point, including writing several Lisp
> > interpreters (that simple s
On 2020-08-06 at 16:08:29 -0700,
Christian Seberino wrote:
> > Trying to maintain that recursive list of unclosed lists in your
> > brain is fun. It stretches the brain in interesting ways. I was
> > way into Lisp at one point, including writing several Lisp
> > interpreters (that simple structur
At 2020-08-06 23:17:57, "Richard Damon" wrote:
>On 8/6/20 10:40 AM, Robin Becker wrote:
>> On 06/08/2020 05:17, ZHAOWANCHENG wrote:
>>> the doc of dictionary said "if a tuple contains any mutable object
>>> either directly or indirectly, it cannot be used as a key."
>>> i think a instance of user
Some problems are well suited to recursion but perhaps //most// problems are
better suited to iteration?
Maybe the spread is 10% vs 90%?
Therefore in general more often the Python way seems simpler than Lisp?
--
https://mail.python.org/mailman/listinfo/python-list
On 2020-08-06 at 20:07:05 -0700,
Christian Seberino wrote:
> Some problems are well suited to recursion but perhaps //most//
> problems are better suited to iteration?
> Maybe the spread is 10% vs 90%?
Citation needed?
> Therefore in general more often the Python way seems simpler than Lisp?
On Fri, Aug 7, 2020 at 11:11 AM Python wrote:
> Not necessarily. Some problems very naturally lend themselves to
> recursive solutions. Fibonacci's sequence is one.
>
> #!/usr/bin/python
>
> def fib(x):
> if x < 1:
> raise "arg must be >= 1"
> if x == 1:
> return 0
>
29 matches
Mail list logo