I am sure there is a better way to refine the following lines.
Letting x equal a number from 1 to 28, go through 28 separate 'if'
statements to print a resulting value that equaled the value of x.
For example:
x = 8
if x = 1, print 'one'
if x = 2, print 'two'
...
...
if x = 8, print 'eight'
..
On 12/15/2014 04:45 PM, Danny Yoo wrote:
As a side note: if we were to talk about how we'd do this in a
professional context, I think we'd recommend a library such as
"humanize", which has functions to go from numbers to human-friendly
string descriptions.
https://pypi.python.org/pypi/huma
On 12/15/2014 05:49 PM, Steven D'Aprano wrote:
On Mon, Dec 15, 2014 at 04:25:42PM -0500, Ken G. wrote:
I am sure there is a better way to refine the following lines.
Letting x equal a number from 1 to 28, go through 28 separate 'if'
statements to print a resulting value that eq
On 12/15/2014 05:59 PM, Dave Angel wrote:
On 12/15/2014 04:25 PM, Ken G. wrote:
I am sure there is a better way to refine the following lines.
Letting x equal a number from 1 to 28, go through 28 separate 'if'
statements to print a resulting value that equaled the value of x.
For e
On 12/15/2014 07:47 PM, Danny Yoo wrote:
Thank you but actually whatever number I get from either 1 to 28,
each number represent a property name such as "Reading Railroad",
"Judy Avenue", "Pacific Gas and Electric", etc., etc.
For example:
if x = 1 then print "Mediterranean Avenue"
if x = 2 th
Wow, just found out this morning that the following
terms of:
import os
pr = os.popen("lpr", "w")
pr.write(month), pr.write(" "),
pr.write("\t\tLine ")
was deprecated. In place there of, there is
a subprocess to use.
I have not been able to figure out on how to use a
subprocess in place of my f
On 02/16/2015 05:11 PM, Danny Yoo wrote:
On Mon, Feb 16, 2015 at 1:26 PM, Ken G. wrote:
Wow, just found out this morning that the following
terms of:
import os
pr = os.popen("lpr", "w")
pr.write(month), pr.write(" "),
pr.write("\t\tLine ")
was d
On 02/16/2015 06:26 PM, Alan Gauld wrote:
On 16/02/15 21:26, Ken G. wrote:
I have not been able to figure out on how to use a
subprocess in place of my former popen. I have been
reading the new materials on the subprocess all day
and it is still not quite understandable.
Here is what the
I wish to thanks Danny Yoo and Alan Gauld
for providing information on using the new
subprocess in printing on paper, replacing
my old popen which was deprecated since
Python 2.6. After some trial and errors,
I got my desired output printed.
Not looking forward to updating my old programs.
Thank
Assuming I have the following list and code how do I best be able
rearrange the list as stated below:
list = [0, 0, 21, 35, 19, 42]
Using print list[2:6] resulted in the following:
221
335
419
542
I would like to rearrange the list as follow:
542
335
221
419
I may have mis-stated my intention. I will rewrite
my request for assistance later and resubmit.
Thanks,
Ken
On 02/26/2015 08:04 AM, Peter Otten wrote:
Steven D'Aprano wrote:
Ah wait, the penny drops! Now I understand what you mean!
Glad I'm not the only one ;)
I have been keeping track of numbers drawn in our local lotto drawings
into a list format as shown in a short example below. Using such list, I
am able to determine how often a number appears within the last 100 plus
drawings.
The length of my lists range from 5, 15, 35, 59and 75 long. I will
On 03/13/2015 10:21 AM, Peter Otten wrote:
Ken G. wrote:
I have been keeping track of numbers drawn in our local lotto drawings
into a list format as shown in a short example below. Using such list, I
am able to determine how often a number appears within the last 100 plus
drawings.
The
On 03/13/2015 10:38 AM, Dave Angel wrote:
On 03/13/2015 09:57 AM, Ken G. wrote:
I have been keeping track of numbers drawn in our local lotto drawings
into a list format as shown in a short example below. Using such list, I
am able to determine how often a number appears within the last 100
I am sure there is an simple explanation but when I input
5 (as integer), resulting in 05 (as string), I get zero as the end
result. When running the code:
START OF PROGRAM:
Enter the 1st number: 5
05
0
END OF PROGRAM:
START OF CODE:
import sys
def numberentry():
print
number01 = raw
On 04/13/2015 08:18 AM, Dave Angel wrote:
On 04/13/2015 08:11 AM, Ken G. wrote:
I am sure there is an simple explanation but when I input
5 (as integer), resulting in 05 (as string), I get zero as the end
result. When running the code:
START OF PROGRAM:
Enter the 1st number: 5
05
0
END OF
On 04/13/2015 08:56 AM, Steven D'Aprano wrote:
On Mon, Apr 13, 2015 at 08:11:46AM -0400, Ken G. wrote:
I am sure there is an simple explanation but when I input
5 (as integer), resulting in 05 (as string), I get zero as the end
result. When running the code:
number01 = 0
Here you se
When running the following code, I get the following
error code:
201504110102030405061
Traceback (most recent call last):
File "Mega_Millions_Tickets_Change.py", line 11, in
datecode[20:21] = "0"
TypeError: 'str' object does not support item assignment
datecode = "201504110102030405061"
On 04/15/2015 08:36 AM, Dave Angel wrote:
On 04/15/2015 08:21 AM, Ken G. wrote:
When running the following code, I get the following
error code:
201504110102030405061
Traceback (most recent call last):
File "Mega_Millions_Tickets_Change.py", line 11, in
datecode[2
On 04/15/2015 08:50 AM, Peter Otten wrote:
Ken G. wrote:
When running the following code, I get the following
error code:
201504110102030405061
Traceback (most recent call last):
File "Mega_Millions_Tickets_Change.py", line 11, in
datecode[20:21] = "0"
Typ
On 04/15/2015 09:09 AM, Steven D'Aprano wrote:
On Wed, Apr 15, 2015 at 08:21:33AM -0400, Ken G. wrote:
When running the following code, I get the following
error code:
201504110102030405061
Traceback (most recent call last):
File "Mega_Millions_Tickets_Change.py&quo
I just emailed that I was unable to correct a message in ModTools
so I went to Yahoo and made the change and then approved it.
Noticing it did not appear on the list, I checked the Activity Log
in Yahoo and it was marked Bounced!
Several days ago, we had another message correction and that
too,
On 04/15/2015 08:45 PM, Dave Angel wrote:
On 04/15/2015 07:47 PM, Ken G. wrote:
I just emailed that I was unable to correct a message in ModTools
so I went to Yahoo and made the change and then approved it.
Noticing it did not appear on the list, I checked the Activity Log
in Yahoo and it
On 04/15/2015 08:21 PM, Alan Gauld wrote:
On 16/04/15 00:47, Ken G. wrote:
I just emailed that I was unable to correct a message in ModTools
so I went to Yahoo and made the change and then approved it.
What is ModTools? What kind of message?
Where does Yahoo fit in?
What does any of it
101 - 124 of 124 matches
Mail list logo