Re: [Tutor] Help!

2009-09-29 Thread wesley chun
> I need help writting a program. > 1) Random string generation > 2) no repeating letters > Can anyone help me,please? I am so confused. The only problem is I have to > use the code that is written there but add on to it. > > import random > > alphabet = "abcdefghijklmnopqrstuvwxyz" > myNewString =

Re: [Tutor] Help!

2009-09-29 Thread Tim Bowden
On Tue, 2009-09-29 at 20:38 -0700, Jessica Poveda wrote: > I need help writting a program. > 1) Random string generation > 2) no repeating letters > Can anyone help me,please? I am so confused. The only problem is I > have to use the code that is written there but add on to it. > > import ran

Re: [Tutor] Not workin!

2009-09-29 Thread Luke Paireepinart
Oops, thanks for catching that one Marty. I thought they both evaluated to false. On 9/29/09, Martin Walsh wrote: > Luke Paireepinart wrote: >> In this case you are saying "is their input equal to this list with many >> elements?" and the answer is always going to be No because a string >> won't

Re: [Tutor] Not workin!

2009-09-29 Thread Martin Walsh
Luke Paireepinart wrote: > In this case you are saying "is their input equal to this list with many > elements?" and the answer is always going to be No because a string > won't be equal to a list unless both are empty. I know you probably didn't mean this as it reads, or as I'm reading it, but an

[Tutor] Help!

2009-09-29 Thread Jessica Poveda
I need help writting a program. 1) Random string generation 2) no repeating letters Can anyone help me,please? I am so confused. The only problem is I have to use the code that is written there but add on to it.     import random alphabet = "abcdefghijklmnopqrstuvwxyz" myNewString = "" for lett

Re: [Tutor] Not workin!

2009-09-29 Thread Luke Paireepinart
> if wellness.strip().lower() in ["well", "fine", "good", "whatever"]: > note if you strip & lowercase the list it is far more likely you'll match > your input. > > And by "lowercase the list" I meant "lowercase the string" of course :) ___ Tutor maillist

Re: [Tutor] Images, and other things.

2009-09-29 Thread Luke Paireepinart
On Wed, Sep 30, 2009 at 1:29 AM, Corey Richardson wrote: > One of my friends was asking if you could make a game using python, but he > meant a Graphics, not text game. I was wondering if that was doable. > Yes, there are many libraries available for doing this. Pyglet is my favorite, but Pygam

Re: [Tutor] Images, and other things.

2009-09-29 Thread Luke Paireepinart
On Tue, Sep 29, 2009 at 6:00 PM, Corey Richardson wrote: > I haven't looked into this, but could you make a real time image using > python? I think it would be most hard > I haven't looked into this, but perhaps your questions are too vague? I think that may be the case What do you mean

[Tutor] Images, and other things.

2009-09-29 Thread Corey Richardson
I haven't looked into this, but could you make a real time image using python? I think it would be most hard Anyway, I am having trouble with int(). I am trying to int(raw_input("some number")), but it returns Traceback (most recent call last): File "C:/Users/Quick-Start/Documents/Python Do

Re: [Tutor] help with alternate execution

2009-09-29 Thread Dave Angel
wrobl...@cmich.edu wrote: I'm trying to make a very simple example to show alternate execution... if a number is divisible by 3 it will say so and if it isnt, it will say so. Heres my program n= raw_input("enter a number= ") def divisible(n): if n%3 == 0: print n, "is divisibl

Re: [Tutor] Not workin!

2009-09-29 Thread Luke Paireepinart
On Tue, Sep 29, 2009 at 11:40 PM, Corey Richardson wrote: > I got suggested to use this format for my code, as it was shorter and > prettier. But It dun work! > if wellness != ["Well","Fine","Good", "OK", "ok", "Ok", "Great", "Awesome", > "Epic"]: > print "Oh, I'm sorry you are not feeling well

Re: [Tutor] Not workin!

2009-09-29 Thread Rich Lovely
2009/9/29 Corey Richardson : > I got suggested to use this format for my code, as it was shorter and > prettier. But It dun work! > if wellness != ["Well","Fine","Good", "OK", "ok", "Ok", "Great", "Awesome", > "Epic"]: >   print "Oh, I'm sorry you are not feeling well." >   areYouOk = raw_input("I

[Tutor] Not workin!

2009-09-29 Thread Corey Richardson
I got suggested to use this format for my code, as it was shorter and prettier. But It dun work! if wellness != ["Well","Fine","Good", "OK", "ok", "Ok", "Great", "Awesome", "Epic"]: print "Oh, I'm sorry you are not feeling well." areYouOk = raw_input("I guessed correct, right?") if areY

Re: [Tutor] Handling missing fields in a csv file

2009-09-29 Thread Dave Angel
Eduardo Vieira wrote: Hello, I have a csv file, a broken csv file using the ";" as a delimiter. This file contains addresses. My problem is that some fields are missing in some rows and I would like to normalize the rows for a smoother import into Excel, for example. Here is an example. This i

Re: [Tutor] help with alternate execution

2009-09-29 Thread vince spicer
On Tue, Sep 29, 2009 at 10:59 AM, wrote: > I'm trying to make a very simple example to show alternate execution... if > a > number is divisible by 3 it will say so and if it isnt, it will say so. > Heres my > program > > n= raw_input("enter a number= ") > def divisible(n): >if n%3 == 0: >

[Tutor] help with alternate execution

2009-09-29 Thread wrobl1rt
I'm trying to make a very simple example to show alternate execution... if a number is divisible by 3 it will say so and if it isnt, it will say so. Heres my program n= raw_input("enter a number= ") def divisible(n): if n%3 == 0: print n, "is divisible by 3" else: p

[Tutor] Question about time.gmtime

2009-09-29 Thread Eduardo Vieira
Hello, I had a problem with a script yesterday that made me puzzled. My time zone is US Mountain Time. This script was running nice last week, but yesterday it reported the date of today instead So, yesterday at 5:20pm this line: hoje = time.strftime("%a, %b %d, %Y", time.gmtime()) Gave me this: "

Re: [Tutor] code improvement

2009-09-29 Thread Patrick Sabin
You could invert your if-expressions, e.g. instead of if query_company_name: ... you could write if not query_company_name: return adresses, company ... This way you could save some indentation. If you want to get rid of the for loops, you could look at list comprehensions, e