[Tutor] Learning Regular Expressions

2016-05-24 Thread Terry--gmail
Running Linux Mint The YouTube Sentdex Video tutor I am following. He is working in Python3.4 and I am running Python3.4.3 He's demonstrating some Regular Expressions which I wanted to test out. On these test scripts, for future referrence, I have been putting my notes in Tripple Quotes and nam

Re: [Tutor] Learning Regular Expressions

2016-05-30 Thread Terry--gmail
Thanks Alan I noticed that I was using some double ' to encircle some things and some single ' for apostrophes in contractionsand fixed those...but apparently since you could run it, that part didn't matter. The problem was ultimately caused by a stray ''' which was a fragment of me messin

[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

[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-17 Thread Terry--gmail
WOW! There is a lot of help on this mailing list! I want to thank everyone for their valuable input! Thanks! (I am working my way through the replies.) Sorry about the HTML. I think I have it turned off now in Thunderbirdy for this address. If so, then what follows should not be flat. If it i

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

2014-08-17 Thread Terry--gmail
I found another place in Thunderbirdy to set 'plain text'. This is a test. Does the below code look correct now? --And did I reply correctly this time? (Reply-All and keep only tutor@python.org address...) for line_number, row in enumerate(catalog2): for col, item in enumerate(row): if le

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

2014-08-17 Thread Terry--gmail
I'm copy and pasting from Ninja-IDE, which I thought was created specifically to do python programming...so I never checked to see if it needs to have the tab set to enter 4 spaces, as it appeared visually to be doing that. But, I don't remember whether I used their tab or manually typed 4 spa

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

2014-08-19 Thread Terry--gmail
The down side of setting the python.org domain to be mailed to as plain text, appears to be that Thunderbirdy has changed all my email to plain text, instead of just the email going to this domainwhich is weird. Leam Hall: I have just one additional function to create in the User Design se

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

2014-08-20 Thread Terry--gmail
Alan Gauld Hi! We are not quite out of the woods on this last example you gave me. It now seems to be complaining that it doesn't want to append an integer to the list or that this isn't the place to use '.append' -- I am probably interpreting it's complaint wrong: Python 3.3 If I run this

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

2014-08-20 Thread Terry--gmail
Terry On 08/20/2014 02:26 PM, Marc Tompkins wrote: On Aug 20, 2014 12:07 PM, "Terry--gmail" <mailto:terry.kemme...@gmail.com>> wrote: > > Alan Gauld > > Hi! > We are not quite out of the woods on this last example you gave me. It now seems to be complaining >

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

2014-08-20 Thread Terry--gmail
lens = [max(col) for col in lens] --Terry IT WORKS! I just don't know how to automatically format lens with enough [] like I was able to tell On 08/20/2014 02:56 PM, Marc Tompkins wrote: On Wed, Aug 20, 2014 at 1:38 PM, Terry--gmail wrote: Marc, my understanding

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

2014-08-20 Thread Terry--gmail
Thanks Japhy Bartlett! [[0] for i in range(5)] Works! I converted to fit into my routine as: lens = [[] for i in range(len(catalog2[0]))] << the new statement for row in catalog2: for col, item in enumerate(row): lens[col].append(len(item)) lens = [max(col) for col in lens]