On Jun 2, 5:05 pm, Dan Bishop <[EMAIL PROTECTED]> wrote:
> On Jun 2, 6:54 pm, greenflame <[EMAIL PROTECTED]> wrote:
>
> > First I should start with some introductory comments.
>
> > When I first learned about programming, I started with BASIC, QBASIC
> > to
First I should start with some introductory comments.
When I first learned about programming, I started with BASIC, QBASIC
to be more accurate. While I was at that stage, I learned about the
INPUT command. I used it abundantly.
Ok so now for the actual issue.
I would like to implement something
Jason wrote:
>
> You cannot do what you are trying to do directly. Strings are
> immutable objects. Once a string is created, that string cannot be
> modified. When you operate on a string, you produce a different
> string. Functions which operate on a string should return their value:
>
> >>>
I want to make a function that does the following. I will call it
thefunc for short.
>>> s = "Char"
>>> thefunc(s)
>>> s
'||Char>>'
I tried the following
def thefunc(s):
s = "||" + s + ">>"
The problem is that if I look at the string after I apply the function
to it, it is not modified. I r
Thanks all for your help!
--
http://mail.python.org/mailman/listinfo/python-list
Thank you all for your replies. The only thing is I do not understand
how the code is working. The following are more particular questions.
Travis: Iam sorry, but I do not know what list comprehension is.
Roberto: I do not understand the first half of the last line of your
code. Also thank you for
I am trying to reorder elements of a list and I am stuck as to what
might be the best way to approach this. I have a (main) list of
elements and another (ordering) list (which is may shorter, but not
longer than the main list) which contains the order in which I want the
elements of the main list
What you said about why my code is wrong is still a bit fuzzy but it
worked!
--
http://mail.python.org/mailman/listinfo/python-list
Ok thanks all!
--
http://mail.python.org/mailman/listinfo/python-list
Is there a way to get rid of a variable as though it never existed? I
know this sounds very basic but I have not come across any such
methods. Also is the fact that I will have a bunch of extra variables
just haning around because my use for them is over a bad thing? I will
likely have on the order
Ok so I played with your script. Here is a script that more closely
mimics what I would like to do except that the way I make the variable
deckstr will be different. The only thing I am confused about is that
it opens the second window in the beginning and when I click on the
button, it does nothin
I have a script that will make a window that shows the text I want
using Tkinter. What I need to do is to make another window popup above
the current window showing other text. I tryed:
---
from Tkinter imprt *
root = Tk()
L = Label(root, text="Blah")
L.grid(row=0, column=0)
# Other lab
Thank you all for all of your help. Also I got the shuffle function to
work. Do not worry I will be back soon with more shuffling! However, I
do not quite understand this DSU that you mention, although it looks
useful.
--
http://mail.python.org/mailman/listinfo/python-list
Zhang Fan wrote:
> On 30 May 2006 20:18:19 -0700, greenflame <[EMAIL PROTECTED]> wrote:
> > Second of all, I would like to have
> > other methods of shuffling, prefererably riffle shuffling and just
> > plain randomly arranging the elements of the list.
>
> The ran
I would like to make a function that takes a list, more specificaly a
list of strings, and shuffles its elements, like a pile of cards. The
following is a script I tryed to make that implements pile shuffling.
--
testdeck = list('qwertyuiop')
def pileshuffle(DECK, NUMPILES):
"""Split
15 matches
Mail list logo