Re: Newbie Question about sequence multiplication

2007-04-08 Thread lancered
On Apr 5, 12:19 am, "Scott" <[EMAIL PROTECTED]> wrote: > Alright, so I've been trying to teach myself Python which, when compared to > my attempt to learn C++, is going pretty well. > But I've come across an issue that I can't figure out, so I figured I'd ask > the pro's. > > Now it looks pretty we

Re: Newbie Question about sequence multiplication

2007-04-06 Thread Steve Holden
Scott wrote: [...] > > Now when suggesting books, keep in mind that, that while I'm new to Python > (and programming in general) I'm able to grasp difficult concepts as long > as I have enough detail as to why it is the way it is. For instance I'm, by > experience and nature, a computer techn

Re: Newbie Question about sequence multiplication

2007-04-06 Thread Scott
Thanks to everyone that respondedI would never have figured that out. 7stud, Your suggestion is being considered lol, as there are a lot more bits of code in that book that I can't get running correctly. Any other books you'd, or anyone for that matter, would recommend as required reading?

Re: Newbie Question about sequence multiplication

2007-04-04 Thread Peter Otten
Scott wrote: > sentence = raw_input('Sentence: ') > > screen_width = 80 > text_width = len(sentence) > box_width = text_width + 6 > left_margin = (screen_width - box_width) // 2 > > print > print ' ' * left_margin + '+'   + '-' * (box_width-2)  +  '+' > print ' ' * left_margin + '|  ' + ' ' * te

Re: Newbie Question about sequence multiplication

2007-04-04 Thread 7stud
On Apr 4, 4:48 pm, "John Machin" <[EMAIL PROTECTED]> wrote: >copied straight from "Beginning Python: From Novice to >Professional", > > > Any help would be greatly appreciated > I suggest you get another book. I am currently reading that book, and unless you are an experienced programmer that can

Re: Newbie Question about sequence multiplication

2007-04-04 Thread attn . steven . kuo
On Apr 4, 3:19 pm, "Scott" <[EMAIL PROTECTED]> wrote: (snipped) > > print > print ' ' * left_margin + '+' + '-' * (box_width-2) + '+' > print ' ' * left_margin + '| ' + ' ' * text_width + ' |' > print ' ' * left_margin + '| ' + ' ' sentence + ' |' > print ' ' * left_margin + '|

Re: Newbie Question about sequence multiplication

2007-04-04 Thread Willy
sentence = raw_input('Sentence: ') screen_width = 80 text_width = len(sentence) box_width = text_width + 6 left_margin = (screen_width - box_width) // 2 print print ' ' * left_margin + '+' + '-' * box_width + '+' print ' ' * left_margin + '|' + ' ' * box_width + '|' print ' ' * left_margin + '|

Re: Newbie Question about sequence multiplication

2007-04-04 Thread Bruno Desthuilliers
Scott a écrit : (snip) > print ' ' * left_margin + '| ' + ' ' sentence + ' |' ^ a '+' is missing here (snip) > Now if i put * before sentence as it is with the rest of the variables, it > actually gets to the point w

Re: Newbie Question about sequence multiplication

2007-04-04 Thread John Machin
On Apr 5, 8:19 am, "Scott" <[EMAIL PROTECTED]> wrote: > Alright, so I've been trying to teach myself Python which, when compared to > my attempt to learn C++, is going pretty well. > But I've come across an issue that I can't figure out, so I figured I'd ask > the pro's. > > Now it looks pretty wei

Re: Newbie Question about sequence multiplication

2007-04-04 Thread Steve Holden
Scott wrote: > Alright, so I've been trying to teach myself Python which, when compared to > my attempt to learn C++, is going pretty well. > But I've come across an issue that I can't figure out, so I figured I'd ask > the pro's. > > Now it looks pretty weird in this format but it was copied exac