Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-15 Thread Joseph Lee
Hi Terry (if that's your name), Start slow - don't think ahead too much. It is a good thing that you know the end product, but sometimes when building a real-life system, you might want to work with one aspect of the program at a time (input, calculations, print, etc.) to make sure it works a

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-15 Thread Joseph Lee
Hi, My thoughts are in the message: - Original Message - From: Terry--gmail Subject: [Tutor] Building Starships -- object of type 'int' has no len() Python 3.3 This has something to do with the nature of FOR statements and IF statements, and I am sure it must be a simple mistake...b

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-15 Thread Dave Angel
Terry--gmail Wrote in message: > > Please don't post here in html mail. Tell your email program to use text. Your program fragment displayed here as a mess, which is one of many problems with html. Please use reply-list (or whatever your email supports, like reply-all and remove the extra r

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-15 Thread leam hall
On a totally side note, I'm watching this because I want to do my own starship stuff. Long time Traveller player. -- Mind on a Mission ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman

Re: [Tutor] Building Starships -- object of type 'int' has no len()

2014-08-15 Thread Marc Tompkins
On Fri, Aug 15, 2014 at 10:46 AM, Terry--gmail wrote: (By the way - your indentation got flattened - cue the inevitable chorus of "DON'T POST TO THIS LIST IN HTML" - so this is my best-guess reconstruction.) > lens = [] > # pre-format the list called lens for maximum number of columns contained i

[Tutor] Building Starships -- object of type 'int' has no len()

2014-08-15 Thread Terry--gmail
Thanks for your response JL. I added the following Exception to the code snippet: for line_number in range(len(catalog2)): for col in range(len(catalog2[line_number])): try: if lens[col] < len(catalog2[line_number][col]): lens[col] = len(catalog2[line_number][col]) except TypeError: print(

[Tutor] Building Starships -- object of type 'int' has no len()

2014-08-15 Thread Terry--gmail
Python 3.3 This has something to do with the nature of FOR statements and IF statements, and I am sure it must be a simple mistake...but I seem to be stumped. I am writing a starship encounter program as my first real python programwhere the user gets a random amount of credits to design

Re: [Tutor] Simple guessing game - need help with the math

2014-08-15 Thread Alan Gauld
On 15/08/14 17:49, Derek Jenkins wrote: I am a newbie (please correct me if I am wrong), but I happen to think that it would be best to suggest that your input be in the same case as that of your variables. In other words, it appears that you are suggesting the user make an input choice of H, L,

Re: [Tutor] Simple guessing game - need help with the math

2014-08-15 Thread Derek Jenkins
I am a newbie (please correct me if I am wrong), but I happen to think that it would be best to suggest that your input be in the same case as that of your variables. In other words, it appears that you are suggesting the user make an input choice of H, L, or C while the program appears to want to

Re: [Tutor] Simple guessing game - need help with the math

2014-08-15 Thread Sibylle Koczian
Am 13.08.2014 01:25, schrieb Greg Markham: while answer == "h" or "l" or "c": print ("My guess is: ", guess, "\n") answer = input("Is it (H)igher? (L)ower? Or am I (C)orrect? ") answer = answer.lower() if answer == "h": guess = round(int(guess + (change/2)))