Cai Gengyang writes:
> This is a piece of code about comparators :
> j# Assign True or False as appropriate on the lines below!
> ...
> When I tried to run it, this is the error I got :
>
> Traceback (most recent call last):
> File "python", line 1, in
> NameError: name 'j' is not defined
Th
Right ... I removed the 'j' and the code works now. I must have accidentally
put it in , forgot about it and thought that it was part of the original code
when it shouldn't have been there in the first place.
Thanks !
On Saturday, November 21, 2015 at 3:27:02 PM UTC+8, Frank Millman wrote:
> "
Jussi Piitulainen writes:
> dieter writes:
>> Chris Angelico writes:
>>
>>> IMO it's controversial mainly because there's an easy and obvious
>>> syntax for early binding, but late binding doesn't have syntactic
>>> support, and all the options are imperfect.
>>
>> I do not think that we should ge
"Cai Gengyang" wrote in message
news:e5d80196-61c5-44d9-bec8-dc563d58f...@googlegroups.com...
This is a piece of code about comparators :
j# Assign True or False as appropriate on the lines below!
[snip rest of code]
When I tried to run it, this is the error I got :
Traceback (most
This is a piece of code about comparators :
j# Assign True or False as appropriate on the lines below!
# Set this to True if 17 < 328 or to False if it is not.
bool_one = 17 < 328 # We did this one for you!
# Set this to True if 100 == (2 * 50) or to False otherwise.
bool_two = 100 == (2 * 50
On Sat, Nov 21, 2015 at 2:30 PM, Dylan Riley wrote:
> I have done so coming up with this piece of work but it doesnt run can anyone
> help me out?
>
Please, please, try to help us out here! What does it mean to "not
run"? Does it run and give an exception? Does it run to completion but
give no o
On Fri, Nov 20, 2015 at 10:30 PM, Dylan Riley
wrote:
> i am learning python and was tasked with making a program that flips a
> coin 100 times and then tells you
> the number of heads and tails.
>
> I have done so coming up with this piece of work but it doesnt run can
> anyone help me out?
>
> #
i am learning python and was tasked with making a program that flips a coin 100
times and then tells you
the number of heads and tails.
I have done so coming up with this piece of work but it doesnt run can anyone
help me out?
#This is credited to dylan
print(" \\ \\ \\ \\ \\ \\ \\ \\ D FLIPS
On Friday, November 20, 2015 at 11:06:05 PM UTC, Rob Gaddi wrote:
> On Fri, 20 Nov 2015 15:15:42 -0500, Terry Reedy wrote:
>
> > On 11/20/2015 12:22 PM, Dylan Riley wrote:
> >> This is my fortune cookie program i wrote in python.
> >> the problem is it will not run past the first line of input.
>
Stephane Wirtel writes:
> in fact, I would like to have a database where I want the requests
> library, I will get the python-requests for debian/ubuntu and the
> right package for the yum installer.
Okay. That's a pretty simple technical problem (a simple relation
between PyPI distribution name
On Fri, 20 Nov 2015 15:15:42 -0500, Terry Reedy wrote:
> On 11/20/2015 12:22 PM, Dylan Riley wrote:
>> This is my fortune cookie program i wrote in python.
>> the problem is it will not run past the first line of input.
>> could someone please identify the error and explain to me why.
>> here is t
On Fri, 20 Nov 2015 09:22:10 -0800 (PST), Dylan Riley
wrote:
>This is my fortune cookie program i wrote in python.
>the problem is it will not run past the first line of input.
>could someone please identify the error and explain to me why.
>here is the code:
>
>#the program silulates a fortune c
> I don't know how the program would detect it, but I'd be thinking "the
> one where 'sudo apt-get install PACKAGENAME' gets the same code that
> 'pip install THING' gets". In a lot of cases, PACKAGENAME will simply
> be python-THING or python3-THING, eg python3-sqlalchemy,
> python3-scipy, python3
Hi Ben,
sorry for my late reply, just forgotten to reply :/ really sorry
in fact, I would like to have a database where I want the requests
library, I will get the python-requests for debian/ubuntu and the right
package for the yum installer.
I have an other solution, but I don't like it because
On 11/20/2015 12:22 PM, Dylan Riley wrote:
This is my fortune cookie program i wrote in python.
the problem is it will not run past the first line of input.
could someone please identify the error and explain to me why.
here is the code:
#the program silulates a fortune cookie
#the program shoul
Hi Denis,
On Fri, Nov 20, 2015 at 05:08:21PM -, Denis McMahon wrote:
> On Fri, 20 Nov 2015 16:53:47 +0100, Peter Otten wrote:
>
> > Ervin Hegedüs wrote:
>
> >> Python has a good string formatter, eg. I can do this:
>
> Or even:
>
> >>> s = "{who} likes {what}"
> >>> d = {'who': "Adam", '
Hi Peter,
On Fri, Nov 20, 2015 at 04:53:47PM +0100, Peter Otten wrote:
> Ervin Hegedüs wrote:
>
> > Python has a good string formatter, eg. I can do this:
> >
> > s = "{who} likes {what}"
> > d = {'who': "Adam", 'what': "ants"}
> > s.format(**d)
> >
> > result:
> > 'Adam likes ants'
> >
> > Is
On Friday, November 20, 2015 at 10:16:34 AM UTC-8, robert...@si.t-com.hr wrote:
> Dana petak, 20. studenoga 2015. u 18:16:52 UTC+1, korisnik Denis McMahon
> napisao je:
> > On Fri, 20 Nov 2015 08:43:04 +0100, HKRSS wrote:
> >
> > > Thanks In Advance, Robert...;)
> >
> > Just keep appending child
On Fri, Nov 20, 2015 at 11:58 PM, srinivas devaki
wrote:
> def __str__(self):
> if len(self.list) == 0:
> return '(' + str(self.data) + ')[...]'
> return ''.join(['(', str(self.data), ')['] + map(str, self.list) +
> [', ...]'])
> ...
> Gist: https://gist.github.co
On Sat, Nov 21, 2015 at 5:16 AM, wrote:
> I Think That LISP Is Only Solution, I Wil Give Up Frpm Python...
Capital Letters For The Win. You Should Consider Talking In German.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Nov 20, 2015 at 11:16 AM, wrote:
> Dana petak, 20. studenoga 2015. u 18:16:52 UTC+1, korisnik Denis McMahon
> napisao je:
>> On Fri, 20 Nov 2015 08:43:04 +0100, HKRSS wrote:
>>
>> > Thanks In Advance, Robert...;)
>>
>> Just keep appending child lists to parent list:
>>
>> l = []
>>
>> wh
On Fri, Nov 20, 2015 at 6:39 PM, Chris Angelico wrote:
> My crystal ball suggests that defaultdict(list) might be useful here.
>
> ChrisA
I used something similar to this for some problem in hackerrank,
anyway i think this is what you want.
class defaultlist(object):
def __init__(self, facto
Dana petak, 20. studenoga 2015. u 18:16:52 UTC+1, korisnik Denis McMahon
napisao je:
> On Fri, 20 Nov 2015 08:43:04 +0100, HKRSS wrote:
>
> > Thanks In Advance, Robert...;)
>
> Just keep appending child lists to parent list:
>
> l = []
>
> while True:
>l.append([])
>
> Until you run out o
On Fri, Nov 20, 2015 at 10:57 AM, Peter Otten <__pete...@web.de> wrote:
> Dylan Riley wrote:
>
>> input("\nPress enter to see your fortune")
>
> Make sure that you run your code with Python 3, not Python 2.
Or if you must use Python 2, use raw_input() instead of input().
>> fortune = random.randr
Thanks all!
--
https://mail.python.org/mailman/listinfo/python-list
Dylan Riley wrote:
> This is my fortune cookie program i wrote in python.
> the problem is it will not run past the first line of input.
> could someone please identify the error and explain to me why.
> here is the code:
>
> #the program silulates a fortune cookie
> #the program should display o
On 11/19/2015 12:17 PM, Patrick Hess wrote:
> ryguy7272 wrote:
>> text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt", "wb")
>> [...]
>> It doesn't seem like the '\n' is doing anything useful. All the text is
>> jumbled together.
>> [...]
>> I finally got it working. It's like this:
>
On Sat, Nov 21, 2015 at 4:22 AM, Dylan Riley wrote:
> This is my fortune cookie program i wrote in python.
> the problem is it will not run past the first line of input.
> could someone please identify the error and explain to me why.
> here is the code:
>
> #the program silulates a fortune cookie
This is my fortune cookie program i wrote in python.
the problem is it will not run past the first line of input.
could someone please identify the error and explain to me why.
here is the code:
#the program silulates a fortune cookie
#the program should display one of five unique fortunes, at ran
On Fri, 20 Nov 2015 08:43:04 +0100, HKRSS wrote:
> Thanks In Advance, Robert...;)
Just keep appending child lists to parent list:
l = []
while True:
l.append([])
Until you run out of memory
But I think that this answer although it appears accurate to the question
is not a solution for any
On Fri, 20 Nov 2015 16:53:47 +0100, Peter Otten wrote:
> Ervin Hegedüs wrote:
>> Python has a good string formatter, eg. I can do this:
>> s = "{who} likes {what}"
>> d = {'who': "Adam", 'what': "ants"}
>> s.format(**d)
>> result:
>> 'Adam likes ants'
>> Is it possible, and if yes, how to reso
Ian Kelly :
> On Fri, Nov 20, 2015 at 9:24 AM, Chris Angelico wrote:
>> The cases where that's not true are usually ones that are more like
>> C++ overloaded functions:
>>
>> def next(iter):
>> return iter.__next__()
>> def next(iter, default):
>> try: return iter.__next__()
>> except
On Fri, Nov 20, 2015 at 9:31 AM, Marko Rauhamaa wrote:
> Ian Kelly :
>
>> On Fri, Nov 20, 2015 at 5:28 AM, Marko Rauhamaa wrote:
>>> One could argue that you should always use a sentinel object for
>>> default values. That also allows you to distinguish between omitted
>>> values and default valu
On Sat, Nov 21, 2015 at 3:31 AM, Marko Rauhamaa wrote:
> Consider the mutator pattern:
>
> def name(self, value=omitted):
> if value is omitted:
> return self._name
> self._name = value
>
> https://en.wikipedia.org/wiki/Mutator_method#C.2B.2B_example>
That shou
On Sat, Nov 21, 2015 at 3:29 AM, Ian Kelly wrote:
> On Fri, Nov 20, 2015 at 9:24 AM, Chris Angelico wrote:
>> The cases where that's not true are usually ones that are more like
>> C++ overloaded functions:
>>
>> def next(iter):
>> return iter.__next__()
>> def next(iter, default):
>> try
Ian Kelly :
> On Fri, Nov 20, 2015 at 5:28 AM, Marko Rauhamaa wrote:
>> One could argue that you should always use a sentinel object for
>> default values. That also allows you to distinguish between omitted
>> values and default values:
>>
>>def asklist(caption, data, n=omitted, rows=omitted
On Fri, Nov 20, 2015 at 9:24 AM, Chris Angelico wrote:
> The cases where that's not true are usually ones that are more like
> C++ overloaded functions:
>
> def next(iter):
> return iter.__next__()
> def next(iter, default):
> try: return iter.__next__()
> except StopIteration: return
On Sat, Nov 21, 2015 at 3:16 AM, Ian Kelly wrote:
>> One could argue that you should always use a sentinel object for default
>> values. That also allows you to distinguish between omitted values and
>> default values:
>>
>>def asklist(caption, data, n=omitted, rows=omitted, width=omitted,
>>
On Fri, Nov 20, 2015 at 5:39 AM, BartC wrote:
> * The persistent nonsense that somehow [] is mutable (what happens is that
> [] is assigned to a variable, and /that/ is mutable) (And I will probably
> get some flak now because 'assign' and 'variable' are meaningless in
> Python!)
I think the prob
On Fri, Nov 20, 2015 at 5:28 AM, Marko Rauhamaa wrote:
> The Ackermann function really is an esoteric example, but the other
> example that has been discussed here can make practical use of the
> default-value semantics:
>
>[ lambda x: i * x for i in range(4) ]
>
> which is salvaged with a def
On 2015-11-20, Vincent Davis wrote:
> On Thu, Nov 19, 2015 at 9:27 PM, Paul Rubin wrote:
>
>> You can't improve much. A decimal digit carries log(10,2)=3.32 bits
>> of information. A reasonable character set for Twitter-style links
>> might have 80 or so characters (upper/lower alphabetic, digi
On 2015-11-20, HKRSS wrote:
>
> Sorry For Bad Question, But I need List Of Lists That I Can
> Acces Horyzontaly, Not In The Deep(But This IS Not All,
> I End That Evey List In List Of Lists Can Be A List...
>
> Thanks In Advance...
> Robert..;)
Not only was that genuine frontier gibberish, it ex
Ervin Hegedüs wrote:
> Python has a good string formatter, eg. I can do this:
>
> s = "{who} likes {what}"
> d = {'who': "Adam", 'what': "ants"}
> s.format(**d)
>
> result:
> 'Adam likes ants'
>
> Is it possible, and if yes, how to resolve the placeholders names
> in string?
>>> import string
Hello Chris,
On Sat, Nov 21, 2015 at 02:06:11AM +1100, Chris Angelico wrote:
> On Sat, Nov 21, 2015 at 1:52 AM, Ervin Hegedüs wrote:
> > Python has a good string formatter, eg. I can do this:
> >
> > s = "{who} likes {what}"
> > d = {'who': "Adam", 'what': "ants"}
> > s.format(**d)
...
> > But
On Sat, Nov 21, 2015 at 1:52 AM, Ervin Hegedüs wrote:
> Python has a good string formatter, eg. I can do this:
>
> s = "{who} likes {what}"
> d = {'who': "Adam", 'what': "ants"}
> s.format(**d)
>
> result:
> 'Adam likes ants'
>
> Is it possible, and if yes, how to resolve the placeholders names
>
Hi,
Python has a good string formatter, eg. I can do this:
s = "{who} likes {what}"
d = {'who': "Adam", 'what': "ants"}
s.format(**d)
result:
'Adam likes ants'
Is it possible, and if yes, how to resolve the placeholders names
in string?
There is a know method:
d1 = {'who1': "Adam", 'what1': "
On 2015-11-20, BartC wrote:
> Finally, a down-to-earth example. Here it probably doesn't matter at
> what point 'global_database' gets bound. You know it will always refer
> to the current state of global_database, and you know that it is a data
> structure external to the function even if it i
On 20/11/2015 13:48, Dennis Lee Bieber wrote:
On Fri, 20 Nov 2015 10:52:53 +0100, marozzyye
declaimed the following:
i am about to download python 3.5.0 but there are three options
1.windows x86 web-based installer
2.windows x86 executable installer
3.windows x86 embeddable zip file
i have tri
On 2015-11-20, Dennis Lee Bieber wrote:
> You can substitute list() where ever you use [] with
> no
> effective change in the semantics. (I wouldn't be surprised if the parser
> was doing that behind the scenes anyway).
No, because list() does a name lookup on "list" (wh
On Thu, Nov 19, 2015 at 9:27 PM, Paul Rubin wrote:
> You can't improve much. A decimal digit carries log(10,2)=3.32 bits
> of information. A reasonable character set for Twitter-style links
> might have 80 or so characters (upper/lower alphabetic, digits, and
> a dozen or so punctuation charact
On 19/11/2015 22:41, Laura Creighton wrote:
In a message of Thu, 19 Nov 2015 22:57:10 +0200, Marko Rauhamaa writes:
Note: Ned Bachelder (who is probably reading this on python-list
anyway added cc on this mail, as if I am to discuss somebody, however
briefly, they deserve to hear about it. Wh
On Friday, November 20, 2015 at 7:40:37 AM UTC-5, BartC wrote:
> On 20/11/2015 12:12, Ned Batchelder wrote:
> > On Friday, November 20, 2015 at 6:59:54 AM UTC-5, BartC wrote:
> >> On 20/11/2015 01:05, Steven D'Aprano wrote:
> >>> On Fri, 20 Nov 2015 04:30 am, BartC wrote:
> >>>
> On 19/11/2015
Dana petak, 20. studenoga 2015. u 14:06:31 UTC+1, korisnik Nagy László Zsolt
napisao je:
> > Sorry For Bad Question, But I need List Of Lists That I Can
> > Acces Horyzontaly, Not In The Deep(But This IS Not All,
> > I End That Evey List In List Of Lists Can Be A List...
> It is not possible to do
On Sat, Nov 21, 2015 at 12:06 AM, Nagy László Zsolt
wrote:
>> Sorry For Bad Question, But I need List Of Lists That I Can
>> Acces Horyzontaly, Not In The Deep(But This IS Not All,
>> I End That Evey List In List Of Lists Can Be A List...
> It is not possible to do it with a native list. But you c
> Sorry For Bad Question, But I need List Of Lists That I Can
> Acces Horyzontaly, Not In The Deep(But This IS Not All,
> I End That Evey List In List Of Lists Can Be A List...
It is not possible to do it with a native list. But you can write your
own iterable that can be iterated forever, and ind
On Fri, Nov 20, 2015 at 11:39 PM, BartC wrote:
> * The refusal to acknowledge that the def fn(a=[]) syntax is misleading.
> (What value will a have when you call fn()? The true answer is that you
> can't tell.)
It isn't misleading. The default value for the argument is set when
the function is de
On 20/11/2015 12:28, Marko Rauhamaa wrote:
BartC :
We're arguing at cross-purposes then since you are obviously
interested in these esoteric aspects,
The Ackermann function really is an esoteric example, but the other
example that has been discussed here can make practical use of the
default
On 20/11/2015 12:12, Ned Batchelder wrote:
On Friday, November 20, 2015 at 6:59:54 AM UTC-5, BartC wrote:
On 20/11/2015 01:05, Steven D'Aprano wrote:
On Fri, 20 Nov 2015 04:30 am, BartC wrote:
On 19/11/2015 16:01, Steven D'Aprano wrote:
[...]
The whole concept of 'mutable' default is alien
BartC :
> On 20/11/2015 01:05, Steven D'Aprano wrote:
>> On Fri, 20 Nov 2015 04:30 am, BartC wrote:
>>> The whole concept of 'mutable' default is alien to me. A default is just
>>> a convenient device to avoid having to write:
>>>
>>> fn(0) or fn("") or fn([])
>>
>> Says who?
>
> People who wa
On Friday, November 20, 2015 at 6:59:54 AM UTC-5, BartC wrote:
> On 20/11/2015 01:05, Steven D'Aprano wrote:
> > On Fri, 20 Nov 2015 04:30 am, BartC wrote:
> >
> >> On 19/11/2015 16:01, Steven D'Aprano wrote:
> > [...]
> >
> >> The whole concept of 'mutable' default is alien to me. A default is jus
On 20/11/2015 01:05, Steven D'Aprano wrote:
On Fri, 20 Nov 2015 04:30 am, BartC wrote:
On 19/11/2015 16:01, Steven D'Aprano wrote:
[...]
The whole concept of 'mutable' default is alien to me. A default is just
a convenient device to avoid having to write:
fn(0) or fn("") or fn([])
Say
"Peter Otten" <__pete...@web.de> wrote in message
news:mailman.510.1448009596.16136.python-l...@python.org...
> HKRSS wrote:
>
>> Thanks In Advance, Robert...;)
>
list_of_lists = []
list_of_lists.append(list_of_lists)
list_of_lists[0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0]
i am about to download python 3.5.0 but there are three options
1.windows x86 web-based installer
2.windows x86 executable installer
3.windows x86 embeddable zip file
i have tried no.1 but while installing there was an error. so which do i pick?
--
https://mail.python.org/mailman/listinfo/python
HKRSS wrote:
> Thanks In Advance, Robert...;)
>>> list_of_lists = []
>>> list_of_lists.append(list_of_lists)
>>> list_of_lists[0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0]
[[...]]
--
https://mail.python.org/mailman/listinfo/python-list
dieter writes:
> Chris Angelico writes:
>
>> IMO it's controversial mainly because there's an easy and obvious
>> syntax for early binding, but late binding doesn't have syntactic
>> support, and all the options are imperfect.
>
> I do not think that we should get additional syntax for lately bound
On Thu, Nov 19, 2015 at 10:31 AM, Michael Torrie wrote:
> One windows it might be possible to use the win32 api to enumerate the
> windows, find your console window and switch to it.
You can call GetConsoleWindow [1] and then SetForegroundWindow [2].
import os
import sys
try:
I Think That There Are Two Ways:
1)Harder Way Use Procedural C...
2)Easier Way Use LISP...
"HKRSS" wrote in message
news:n2miu8$fl4$1...@ls237.t-com.hr...
> Thanks In Advance, Robert...;)
>
>
--
https://mail.python.org/mailman/listinfo/python-list
Thanks In Advance, Robert...;)
--
https://mail.python.org/mailman/listinfo/python-list
68 matches
Mail list logo