Re: [Tutor] "List" object is not callable

2016-05-01 Thread Jason N. via Tutor
Hello, I figured out the issue. It was a silly mistake - i was not running the correct code; instead was running code from another program which was active on a second tab. Thank you. On Sunday, May 1, 2016 4:15 PM, Jason N. via Tutor wrote: Thank you all for your

Re: [Tutor] simple regex question

2016-05-01 Thread Alan Gauld via Tutor
On 01/05/16 20:04, bruce wrote: > Hey all.. > > Yeah, the sample I'm dealing with is html.. I'm doing some "complex" > extraction, and i'm modifying the text to make it easier/more robust.. > > So, in this case, the ability to generate the line is what's needed > for the test.. > But as Peter

Re: [Tutor] int(1.99...99) = 1 and can = 2

2016-05-01 Thread boB Stepp
On Sun, May 1, 2016 at 5:43 AM, Steven D'Aprano wrote: > On Sun, May 01, 2016 at 01:02:50AM -0500, boB Stepp wrote: >> Life has kept me from Python studies since March, but now I resume. >> Playing around in the interpreter I tried: >> >> py3: 1. >> 2.0 >>

Re: [Tutor] "List" object is not callable

2016-05-01 Thread Jason N. via Tutor
Thank you all for your responses.  I am using Py 2.7 and this time I copied and pasted the code from here: http://www.opentechguides.com/how-to/article/python/57/python-ping-subnet.html  to my system but received the same error when I ran it.  You can see the error screenshot here: 

Re: [Tutor] Issues converting a script to a functioin (or something) [SOLVED]

2016-05-01 Thread Olaoluwa Thomas
Gotcha. *Warm regards,* *Olaoluwa O. Thomas,* *+2347068392705* On Sun, May 1, 2016 at 7:14 PM, Alan Gauld via Tutor wrote: > On 01/05/16 14:38, Olaoluwa Thomas wrote: > > > Thanks for your feedback. Please do not hesitate to provide more as I > shall > > email you personally

Re: [Tutor] simple regex question

2016-05-01 Thread Alan Gauld via Tutor
On 01/05/16 17:49, bruce wrote: > Hi. I have a chunk of text code, which has multiple lines. > s=''' > id='CourseId10795788|ACCT2081|002_005_006' style="font-weight:bold;" > onclick='ShowSeats(this);return false;' alt="Click for Class Availability" > title="Click for Class

Re: [Tutor] Issues converting a script to a functioin (or something) [SOLVED]

2016-05-01 Thread Alan Gauld via Tutor
On 01/05/16 14:38, Olaoluwa Thomas wrote: > Thanks for your feedback. Please do not hesitate to provide more as I shall > email you personally in the future. Please don't do that. a) Bob is a busy man who volunteers his time here, but may have other things to do too. b) The list is here so

Re: [Tutor] Issues converting a script to a functioin (or something)

2016-05-01 Thread Alan Gauld via Tutor
On 01/05/16 12:55, Olaoluwa Thomas wrote: > It computes total pay based on two inputs, no. of hours and hourly rate. While you do specify two inputs you immediately throw them away and ask the user to provide the information. In general it is good practice to separate calculation from

Re: [Tutor] Issues converting a script to a functioin (or something)

2016-05-01 Thread Sreenathan Nair
On Sun, May 01, 2016 at 5:34 PM, Olaoluwa Thomas < thomasolaol...@gmail.com [thomasolaol...@gmail.com] > wrote: The novice Python programmer is back. I'm trying to incorporate a function and its call in the GrossPay.py script that Alan solved for me. It computes total pay based on two inputs,

Re: [Tutor] Issues converting a script to a functioin (or something) [SOLVED]

2016-05-01 Thread isaac tetteh
You have two arguments in you function but when you call the function no argument is set in. Take the arguments out from the function if you want to use the the values from the user. Sent from my iPhone > On May 1, 2016, at 8:41 AM, Olaoluwa Thomas wrote: > > Hi

Re: [Tutor] simple regex question

2016-05-01 Thread Peter Otten
bruce wrote: > Hi. I have a chunk of text code, which has multiple lines. > > I'd like to do a regex, find a pattern, and in the line that matches the > pattern, mod the line. Sounds simple. > > I've created a test regex. However, after spending time/google.. can't > quite figure out how to

[Tutor] simple regex question

2016-05-01 Thread bruce
Hi. I have a chunk of text code, which has multiple lines. I'd like to do a regex, find a pattern, and in the line that matches the pattern, mod the line. Sounds simple. I've created a test regex. However, after spending time/google.. can't quite figure out how to then get the "complete" line

Re: [Tutor] Issues converting a script to a functioin (or something) [SOLVED]

2016-05-01 Thread Olaoluwa Thomas
Hi Bob, Thanks for your feedback. Please do not hesitate to provide more as I shall email you personally in the future. The script is made up of a function definition and its call prompting the user for input. The script itself takes "number of hours worked" and "hourly rate" as inputs and

Re: [Tutor] Python Homework

2016-05-01 Thread Bob Gailer
On May 1, 2016 4:33 AM, "Katie Tuite" wrote: > > I'm trying to do a python homework question and cannot figure out how to > start at all. > > This is the question > > [image: pasted1] As you can see attachments don't work. Include the code in your post. >

Re: [Tutor] Issues converting a script to a functioin (or something)

2016-05-01 Thread Bob Gailer
On May 1, 2016 8:04 AM, "Olaoluwa Thomas" wrote: > > The novice Python programmer is back. Welcome back. We are here to help you when you are stuck. Telling us something is broken is not adequate. Tell us-what you are expecting the program to do and what results you're

[Tutor] Issues converting a script to a functioin (or something)

2016-05-01 Thread Olaoluwa Thomas
The novice Python programmer is back. I'm trying to incorporate a function and its call in the GrossPay.py script that Alan solved for me. It computes total pay based on two inputs, no. of hours and hourly rate. There's a computation for overtime payments in the if statement. Something seems to

Re: [Tutor] int(1.99...99) = 1 and can = 2

2016-05-01 Thread Steven D'Aprano
On Sun, May 01, 2016 at 01:02:50AM -0500, boB Stepp wrote: > Life has kept me from Python studies since March, but now I resume. > Playing around in the interpreter I tried: > > py3: 1. > 2.0 > py3: 1.999 > 1.999 Correct. Python floats carry 64 bits of

Re: [Tutor] META: Moderation and subscription to the tutor list

2016-05-01 Thread Alan Gauld via Tutor
On 01/05/16 07:23, boB Stepp wrote: > I am in agreement with this as well. I have often wondered if > newcomers are subscribed or not Most are. Several who are not, subscribe very soon after - presumably in response to the intro message. > as after subscription one receives a > very helpful

Re: [Tutor] META: Moderation and subscription to the tutor list

2016-05-01 Thread Alan Gauld via Tutor
On 01/05/16 10:06, Alan Gauld via Tutor wrote: > Quite a lot of people use the digest service, especially lurkers. > (A quick scan of the members lists suggests around 35-40% > of all members use digest). I'd be reluctant to remove a > service that is so widely used. I've just had a look at the

Re: [Tutor] META: Moderation and subscription to the tutor list

2016-05-01 Thread Alan Gauld via Tutor
On 01/05/16 06:35, c...@zip.com.au wrote: > There seems to me a subjectly large number of very short threads with a > question from someone, a couple of responses from list members, and no > further > reply. > > To me this argues that either newcomers are not subscribed and probably do > not

Re: [Tutor] META: Moderation and subscription to the tutor list

2016-05-01 Thread Alan Gauld via Tutor
On 01/05/16 05:18, Steven D'Aprano wrote: > What's your policy here on the tutor list? I don't really have a policy. The list policy, set by my predecessors, is to allow anyone to send mail and encourage them to subscribe. All unsubscribed mail goes to moderation (and there is not very much of

Re: [Tutor] Issue with Code [SOLVED]

2016-05-01 Thread Alan Gauld via Tutor
On 01/05/16 05:20, Olaoluwa Thomas wrote: > Thank you so much, Alan. That fixed it (See Script 2[SOLVED] below). > > For the purpose of record-keeping, I'm pasting the entire code of all > scripts below as I should have done from the very beginning. > thanks :-) > P.S. How were you able to

Re: [Tutor] Python Homework

2016-05-01 Thread Ben Finney
Katie Tuite writes: > I'm trying to do a python homework question and cannot figure out how > to start at all. You'll need to help us more than that :-) What is the confusion you have? What do you understand so far? Can you re-phrase the question in your words, so we can

[Tutor] Python Homework

2016-05-01 Thread Katie Tuite
I'm trying to do a python homework question and cannot figure out how to start at all. This is the question [image: pasted1] ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] int(1.99...99) = 1 and can = 2

2016-05-01 Thread eryk sun
On Sun, May 1, 2016 at 1:02 AM, boB Stepp wrote: > > py3: 1. > 2.0 > py3: 1.999 > 1.999 ... > It has been many years since I did problems in converting decimal to > binary representation (Shades of two's-complement!), but I am under

Re: [Tutor] META: Moderation and subscription to the tutor list

2016-05-01 Thread boB Stepp
On Sun, May 1, 2016 at 12:35 AM, wrote: > On 01May2016 14:18, Steven D'Aprano wrote: >> >> Hi Alan, >> >> I thought I'd mention that the list-owners of "python-list" have now >> decided to only allow people to post if they are subscribed to the list: >> >>

Re: [Tutor] META: Moderation and subscription to the tutor list

2016-05-01 Thread cs
On 01May2016 14:18, Steven D'Aprano wrote: Hi Alan, I thought I'd mention that the list-owners of "python-list" have now decided to only allow people to post if they are subscribed to the list: https://mail.python.org/pipermail/python-list/2016-April/707571.html The

[Tutor] int(1.99...99) = 1 and can = 2

2016-05-01 Thread boB Stepp
Life has kept me from Python studies since March, but now I resume. Playing around in the interpreter I tried: py3: 1. 2.0 py3: 1.999 1.999 py3: int(1.) 2 py3: int(1.999) 1 It has been many years since I did problems in