a dummy like me can understand.
Also tell us what you tried and how it failed.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
e should be true
(() returns False which is correct
I can't find the error please help me
What do you tkink matches returns, and why?
Therein is the problem.
Also FWIW you import Stack them redefine it. Why?
--
Bob Gailer
919-636-4239
Chapel Hill NC
__
o do the append method to fix it?
--
Dave Merrick
merrick...@gmail.com <mailto:merrick...@gmail.com>
Ph 03 3423 121
Cell 027 3089 169
_______
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/lis
of the worst things you can do in an application.
If the message isn't important enough to require it to stay visible
until the user explicitly closes it, then it shouldn't go into a dialog
in the first place.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
'Schenectady', 'region_name': 'NY', 'area_code': 518},
{'city': 'Athens', 'region_name': '35'}]
IMHO this is overkill.
Consider instead using City-Region as the key and storing the pther
attributes in a tuple. There
tain selection
from the user. What
Why did you expect to be able to alter the value of a tuple element?
Tuples are immutable! Use a list instead.
HTH
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
for one of the 4
strings, strength, health, wisdom, or dexterity).
DON'T USE TUPLES. WHY DO YOU INSIST ON THEM?
What does the error message( unsupported operand type(s) for -:
'str' and 'int') tell you?
Why would selection be a string rather than an in
if a + b == 10:
#print('Si!')
return(True)
else:
#print('Nein!')
return(False)
makes10(10,9)
#makes10(9,9)
#makes10(1,9)
In particular, the 'if (a == 10) or (b == 10): line... is there a
shorter/more compact/more correct (i.e. pythonic) way o
Original Message
Subject:Re: [Tutor] largest palindrome number
Date: Tue, 30 Aug 2011 23:24:09 +0530
From: surya k
To: bob gailer
Mr Gailer,
That's an amazing way of writing palindrome function. Actually, I'm
still using my old C logic's he
% is not remainder - it is modulo.
Difference shows up when left agument is negative.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman
beats " + computer
wins += 1 # simpler than wins = wins + 1
else:
print "You lose! " + computer + " beats " + player
loses +=1
print """Game Summary
Wins: %s
Loses:" %s""" % (wins,loses)
es)
Any explanation you have would be helpful.
Thanks for taking the time to help the newbie!
Joey
On Thu, Sep 22, 2011 at 6:35 PM, bob gailer <mailto:bgai...@gmail.com>> wrote:
On 9/22/2011 1:04 PM, Joseph Shakespeare wrote:
Hello,
Hi - please use a meaningful subjec
.8,0.8
cax = plt.axes([l+w+0.025,
b, 0.025, h], )
cbar=plt.colorbar(CS,
cax=cax, drawedges=True)
#save map as *.png and
plot netcdf file
quot;" and ''' and that \" and \'
are escaped and therefore not delimiters.
Write a program that attempts to meet these requirements, show it to us,
tell us that is succeeds or where it fails and let's go from there.
--
Bob Gailer
919-636-4239
Chapel Hill NC
_
ook me", tries, "tries. Can you beat me?")
input("\n\nPress enter key to exit.")
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
--
Bob Gaile
ussion and work with help.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
{'E': [1]})
(1, '-', {'E': [2]})
(2, '-', {'E': [2]})
which is not what you want!
As requested before, show us the output you do want. Not a description
but the actual output.
-- Bob Gailer 919-636-4239 Chapel Hill NC
__
execute it?
The more detailled and explicit you are the easier it is to help you.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
gives you grief then tackle it one task at a time. For example,
open, read, print, close a file. Then add another level of complication,
for example open, read, split, print, close a file.
The part that makes no sense to me is score = OS.system(str). What will
str be and what do
On 10/5/2011 5:51 PM, Christopher King wrote:
There is a program that will open another program, write code at the
top of the program. The code at the top will cause the program to
print all strings afterwards in swap case.
Please provide a sample program that you wish to modify.
--
Bob
x27;t do this with Python 2, as print is a statement and can't be
redefined. You could alter the program - find all occurrences of "print"
used as a statement, and replace them with a function call. So
print "asdf" would become swapprint("asdf")
and at the to
uot; beats " + computer
wins += 1 # simpler than wins = wins + 1
else:
print "You lose! " + computer + " beats " + player
loses +=1
print """Game Summary
Wins: %s
Loses:" %s""" % (wins,loses) # u
bership_pkg_option_id, membership_status_id, membership_source_id,
src_input_channel_id,
src_market_id, person_id_ref, membership_id, member_start_dt,
current_term_start_dt, started_as_trial,
created_by, modified_by, create_dt, modified_dt, enterprise_person_id)
values (?,?,?,?,?,?,?,?,?,?,?,?
see if the program runs to completion.
On Fri, Oct 7, 2011 at 1:35 PM, bob gailer <mailto:bgai...@gmail.com>> wrote:
On 10/7/2011 2:19 PM, Guess?!? wrote:
Hello all,
I am trying to create some test data for a search module that I
am building. Since I dont wa
modified_dt,
enterprise_person_id)
values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)""", record)
conn.commit()
i = i + 1
c.close()
___________
Tutor maillist -Tutor@python.org <mailto:Tutor@python.org>
To unsubsc
publibfp.dhe.ibm.com/epubs/pdf/dfsc4a01.pdf.
Chapter 1 is a good starting place. There are references to
mainframe-specific stuff that you may safely ignore.
If this inspires you or not, let me know.
I would enjoy some partnership working on this.
--
Bob Gail
.
They "test" f2c. The test code is complicated by the use of % for formatting.
You might be better off doing it this way to avoid the complication of learning %
formatting.
t = 212
print "f2(" + t +") = " + f2c(t) + " expected: 100"
Now you are to
lt; 11:
i += 1
loop body
Your choice - that's all know of - and the for is easier to read and
write than the while.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
;)):pass
print time.time() - start
HTH
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
wait to receive data.
All the socket software (Python or other) does is receive a string. What
you do with it is up to you. If you apply eval or exec to it than
anything could happen. No one can IMHO cause any action via socket.
[snip]
--
Bob Gailer
919-636-4239
too
small to convert to float, raising an overflow exception.
Allof this raises the question - what computer algorithms
successively approximate pi exactly?
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tuto
to monitor progress how about addind
something so you know which print statement was called. Perhaps print "I
am here 1", print "I am here 2", etc.
Why have the file at all? Why not just start with c = range(1,1000)?
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
One more thing -
tlock = thread.allocate_lock()
should be executed once before starting threads.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org
etc.
* Why have the file at all? Why not just start with c = range(1,1000)?
* Why print the entire list? (print c)?
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
know the complete program ...just give me
some time ..
On 10/19/2011 10:35 PM, bob gailer wrote:
On 10/19/2011 11:50 AM, Navneet wrote:
Thank you Bob and Dave,
Yes the file is as you expected,
I don't understand that comment.
I thought it is easy to figure out that you have to ch
On 10/22/2011 12:09 PM, lina wrote:
Hi,
I googled for a while, but failed to find the perfect answer,
for a string
['85CUR', '85CUR']
how can I unique it as:
['85CUR']
Try
set(['85CUR', '85CUR
h that subsequent calls have different behavior.
All of these could be done differently, but reassigning methods makes
the most sense to me.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
dictionary.
This will fail (as any other reverse dictionary approach will) if the
values are not hashable
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http
some confusion both in the question and the proposed
solutions regarding "lowercase".
Re your e.g. - is that the original or the result?
It's best to show both.
I have to assume that your e.g. is the original since it contains upper
case letters.
Do you want to change the case o
, at 22:49, bob gailer <mailto:bgai...@gmail.com>> wrote:
On 10/27/2011 2:25 PM, ADRIAN KELLY wrote:
Hi all,
is it possible to change a dictionary list to lowercase..without
having to retype?
e.g. definitions={"Deprecated": "No longer in use", "Deprecia
- Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://ma
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change s
lay the last card in each pile:
for pile in piles:
print values[pile[-1]],
What will your actual display look llike?
Will you completely reprint it after each move, or alter it in place?
How will you get the moves from the player?
--
Bob Gailer
919-636
e B
and put it on pile H.
--------
*From:* bob gailer
*To:* Elwin Estle
*Cc:* "tutor@python.org"
*Sent:* Tuesday, November 15, 2011 9:18 PM
*Subject:* Re: [Tutor] list of objects?
On 11/15/2011 8:40 AM, Elwin Estle wrote:
I am attempting to write a text based spider solitaire
characters to be encoded ??
Your question makes no sense to me. Please explain what you mean by
encoding letters?
An example of input and output might also help.
Be sure to reply-all.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist
.
[snip]
Another way of saying that is:
Translate those parts of the pseudocode to Python that you can.
Tell us where you are stuck.
The book certainly gives you enough information to do that.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist
d your first question. Dictionaries do not have
duplicate keys. Your 2nd assignment using the key "Elway" replaced the
first.
2) Is there a way to print out the actual value of the key, like
Montana would be 0, Tarkington would be 1, etc?
Actual value? The actual value of Montana" is "Montana". Sounds like you
want the index of the entry as though it were in a list. Dictionaries
are not ordered so you can't get that unless you store it as part of the
value.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
the desired result.
In theory the loop could run for a long time, as you could get an arbitrarily
long run of words that are already in the random_word_list. How could you fix
that?
There are any number of ways to simplify and improve the program. Are you
interested in hearing about them?
= name[1:]
What I want here is.. If the name starts with 'm' or 'f' or 'b', The
first letter should be removed.
But this isn't happening here.
Hugh answered your question.
PLEASE in future post in plain text rather than HTML.
--
Bob Gailer
919-636-423
"m" or "f" or "b" gets evaluated first. The result is "m" (the first
non-false value)
then name[0] == "m" gets evaluated, which may be true or false.
the shortest way is name[0] in "mfb"
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
ex.X = lonValue
vertex.Y = latValue
vertexArray.add(vertex)
polylineArray.add(currentPoint)
cursor = arcpy.InsertCursor(shapefile)
row = cursor.newRow()
row.Shape = vertexArray
cursor.insertRow(row)
del cursor
_______
Tutor maillist - Tut
[1]
to access that index
When passing to a function, you do this: findindex(*b)
___________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
--
Bob Gailer
919-636
osses = ''.join(random.choice("HT") for i in range (N))
w = min(tosses.find("TTT") % N + 1,tosses.find("HHH") % N + 1)
if w == N: print 'no winner'
else: print tosses[:w+2], 'player %s wins.' %((w % 2) + 1,)
--
Bob Gailer
919-636-4239
Chap
On 11/29/2011 6:40 PM, emile wrote:
Dave Angel wrote:
... single use punch cards...
You didn't have an IBM 719 CARD punch? (ChAd Restoration Device). Made
reuse of punch cards very easy.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
interest like here? Let me know and I will give you
guys a heads up when I get everything all set up.
I'm interested too.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
ad to copy it elsewhere to even read it.
Check out the drop-down box on the upper right. Choose Clean
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.o
27;, 'o', 'o']
Why is that "u" coming in the middle from no where ??
input is returning user entry as unicode.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
same sum-of-5th-powers as 23154. Compute the sum then
see if it is composed of the source digits.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org
On 12/18/2011 5:45 PM, Stayvoid wrote:
Hey there!
How to set it right?
You may not get an answer as your question is pretty vague.
Please clarify, or expand, or tell us what problem you are having or
trying to solve.
--
Bob Gailer
919-636-4239
Chapel Hill NC
>>> "™"
'\xe2\x84\xa2'
What is this hex string?
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
ssion_list.
The suite is then executed once for each item provided by the iterator,
in the order of ascending indices. Each item in turn is assigned to the
target list using the standard rules for assignments, and then the suite
is executed. When the items are exhausted (which is immediately wh
s a list consisting of tuples
containing the corresponding items from all iterables (a kind of
transpose operation). The /iterable/ arguments may be a sequence or
any iterable object; the result is always a list.
>>> print map(lambda x, y : x + y, (1,2,3), (4,5,6))
[5, 7, 9]
--
but not so for negative a.
>>> 5%3
2
>>> -5%3
1
>>>
FWIW the Python documentation (at least as of 2.7.2 has this wrong!)
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubs
space-separated-tokens".
List indexing starts at 0, so tobetranslatedparts[2] refers to the 3rd
item of the list that was created by split().
If that does not help, please show us some sample lines.
--
Bob Gailer
919-636-4239
Chapel Hill NC
__
nt?
Second problem, but not a big one, is when I print the lists of names
as they are entered, I get quotations around the name.
I bet you are seeing something like ['joe', pete'] since you are
printing a list. true? In general copy and paste the undesired output in
the email
ay to do this, preferably without closing IPython?
in "normal" python:
import sys
reload(sys.modules['mymodule '])
from mymodule import myfunc
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
ntire module, but I confess I
don't know how to reload a function using import like that... reload
doesn't seem to have any option for that
I'll watch this space to see if anyone else knows how.
Good idea. And now you know.
--
Bob Gailer
919-636
I for one prefer plain text rather than HTML for email.
Please in the future post plain text. No colors, no unusual fonts.
Makes it a LOT easier to read.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To
gram with a call to a function, Python does NOT
display the returned value.
A function that does not execute a return will return None; in the
interactive window nothing is displayed.
Is that sufficient?
--
Bob Gailer
919-636-4239
Chapel Hill NC
_
>>> a
3
IOW if the line is blank, start with # or is a statement the interpreter
does not print anything (unless it is a print statement). For a messy
example:
>>> if 1:3;a=4;a
...
3
4
--
Bob Gailer
919-636-4239
Chapel Hill NC
_
todownload unknowns. I
even tried the Play Online and got to another messy connfusing site,
Could you give an overview of the game?
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription op
answer the more likely you are to get
answers. We volunteer our time to help you; we are not paid money for
our service.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscriptio
thing went awry with the internet connection between
your computer and the SMTP server. Best strategy I know of is to trap
the exception and retry, but for a limited # of times.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tuto
"epeat previous command". I
can think of several unrelated meanings.
Personally I prefer an IDE. My favorites are PyCharm ($) and Python for
Windows (free).
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To u
so a
lava drop could become a sand grain.
That's all for now. Good coding!
I don't want to copy the game
Is there a Python version out there?
, I want to make my own to play around with Py(thon/game).
--
Bob Gailer
919-636-4239
Chapel Hill NC
quot; from
it? They are copied.
2 - comparing an integer to a string is always False
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
ALUE
Now you know, and you know how to find out!
To delve any deeper you'd have to inspect the c source for pow.
I'd assume it uses the c exponent operator
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
info/tutor
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
old in place.
No one else caught this problem!
Since this is homework we we probably should not be offering alternative
solutions.
However I can't resist offering the one-line solution:
''.join(str(int(x)+1) if x.isdigit() else x for x in
I recommend Pam use another computer to publish events.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
e 12 cats?'''
return AlterInput(user_input.split())
Your code:
return ' '.join(str(int(num)+1) if num.isdigit() else num for num in
user_input)
On Wed, Feb 8, 2012 at 6:04 AM, bob gailer <mailto:bgai...@gmail.com>> wrote:
On 2/8/2012 12:56 AM, Mi
learned conditional expressions, list comprehensions and
generator expressions then you will be able to write the code I did.
That code is just an alternative to what you wrote, "flattening it" as
it were.
[snip]
--
Bob Gailer
919-636-4239
Chap
On 2/9/2012 6:56 PM, Steven D'Aprano wrote:
bob gailer wrote:
Today is the third time Pam (connecting to the web site for event
publication) has run into an inexplicable Access error.
I don't think this has anything to do with learning Python.
You are right. I was surprised to
en are hard to follow, and a lot depends on
how your system is configured. Once we see the error you are getting we
can better help.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subs
i tried
print 'hello world','blue'
Where did you get the idea that that would do what you want? Did you
read the documentation regarding print? Please do not post stuff that is
obviously wrong!
No one can tell you how to create colored output until we know where yo
tanding_Amount,to
make an increment?
Please, is it the same thing with the withdrawing format, in case i
want to decrement the account as in withdrawing??
joseph
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
se confirm or
explain.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
logic.
Another approach is using try and except as others have mentioned.
However I doubt whether your course has introduced exception handling.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
except ValueError:
continue
new_text = MultiplyText(text, multiplier)
return new_text
if __name == '__main__':
print GetUserInput()
To fix both problems replace
multiplier.isdigit()
with
multiplier = int(multiplier)
--
Bob Gailer
919-636-4239
Chapel
put('Height: ')
while h <= 0:
print 'Must be a positive number'
h = input('Height: ')
print 'Width =',w,' Height =',h,' so Area =',area(w,h)
___
Tutor maillist - Tutor@python.org
the grid to display with the initial state.
Then step back, say "well done,Leo" then add code to advance to
subsequent states with some limit.
I'll post the code that I already have later today.
--
Bob Gailer
919-636-4239
Chapel Hill NC
__
l J. Lewis
_______
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
7;2' is the question what is "recipe.txt" + 2>
If you come up with anything other than "recipe.txt2" then you need to
review how Python works.
Another idea is: when you get an unexpected result there must be a very
good reason for it. Do a little hunting. Each time you
(most recent call last):
File "C:/Python27/Card Game.py", line 69, in
print my_hand
File "C:/Python27/Card Game.py", line 25, in __str__
for card in self.card:
AttributeError: 'Hand' object has no attribute 'card'
>>>
/*Would you please help me as to where I got it wrong with this
program
ct), an if-elif-else statement, and the use of
Python's random number generator.
Do you know how to create a loop? If not, why not?
Do you know how to test for low or high? If not why not?
If your answers to these questions is no then (IMHO) you are in the
wrong class.
--
Bob Gailer
91
ommand"
If I was running your program and saw that I'd have to give up since I
have no idea what is expected.
print "Please enter command - r for roman-arabic"
would be much better.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On 2/28/2012 11:40 AM, Peter Otten wrote:
def product(factors, product=1):
for factor in factors:
product *= factor
return product
can be "simplified"
def product(factors):
import operator
return reduce(operator.mul, factors)
--
Bob Gailer
919-636-4239
Chap
GUI - task manager
cmd line - taskkill
" running for long time" is relative and irrelevant. Above stops regardless.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription opt
the above in the hopes of gaining insight.
Perhaps you could restate the problem in a way that makes it crystal clear.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options
1001 - 1100 of 1317 matches
Mail list logo