Re: Plz comment on this code

2010-09-20 Thread Lawrence D'Oliveiro
In message b4616683-ad1e-4fd2-9595-5386333b9...@y31g2000vbt.googlegroups.com, Alex Willmer wrote: On Sep 19, 12:20 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message fdd04662-0ae7-46a3-a7d3-d6bb00438...@j19g2000vbh.googlegroups.com, Alex Willmer wrote: # NB

Re: Plz comment on this code

2010-09-20 Thread Steven D'Aprano
On Mon, 20 Sep 2010 19:33:45 +1200, Lawrence D'Oliveiro wrote: WHAT_IF_SOMETHING_IS_INITIALLY_CONSTANT,_BUT_LATER_BECOMES_A _CONFIG_VARIABLE,_OR_VICE_VERSA,_DOES_IT_NEED_TO_CHANGE_ITS_NAME? If you want to be compliant with PEP 8, then yes. -- Steven --

Re: Plz comment on this code

2010-09-19 Thread Peter Otten
fridge wrote: # bigdigits2.py import sys zero=[***, * *, ***] one=[***, * , ***] digits=[zero,one,zero,one,zero,one,zero,one,zero,one] inputted_digit=sys.argv[1] column_max=len(inputted_digit) row_max=3 r=0 while r3: line= c=0 while ccolumn_max:

Re: Plz comment on this code

2010-09-19 Thread Alex Willmer
Your code works (assuming digits gets populated fully), but it's the absolute bare minimum that would. To be brutally honest it's: - unpythonic - you've not used the core features of Python at all, such as for loops over a sequence - poorly formatted - Please read the python style guide and

Re: Plz comment on this code

2010-09-19 Thread Lawrence D'Oliveiro
In message fdd04662-0ae7-46a3-a7d3-d6bb00438...@j19g2000vbh.googlegroups.com, Alex Willmer wrote: # NB Constants are by convention ALL_CAPS SAYS_WHO? -- http://mail.python.org/mailman/listinfo/python-list

Re: Plz comment on this code

2010-09-19 Thread Lawrence D'Oliveiro
In message 4c957412$0$3036$afc38...@news.optusnet.com.au, fridge wrote: digits=[zero,one,zero,one,zero,one,zero,one,zero,one] digits = [zero, one] * 5 row_max=3 Defined but never used. digit_i=int(inputted_digit[c]) digit=digits[digit_i] line+=digit[r] line+= Too many

Re: Plz comment on this code

2010-09-19 Thread Alex Willmer
On Sep 19, 12:20 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message fdd04662-0ae7-46a3-a7d3-d6bb00438...@j19g2000vbh.googlegroups.com, Alex Willmer wrote: # NB Constants are by convention ALL_CAPS SAYS_WHO? Says PEP 8: Constants Constants are usually

Plz comment on this code

2010-09-18 Thread fridge
# bigdigits2.py import sys zero=[***, * *, ***] one=[***, * , ***] digits=[zero,one,zero,one,zero,one,zero,one,zero,one] inputted_digit=sys.argv[1] column_max=len(inputted_digit) row_max=3 r=0 while r3: line= c=0 while ccolumn_max: digit_i=int(inputted_digit[c])

Re: Plz comment on this code

2010-09-18 Thread Jason Swails
On Sat, Sep 18, 2010 at 10:23 PM, fridge fri...@micro.com wrote: # bigdigits2.py ^ Here is the comment import sys zero=[***, * *, ***] one=[***, * , ***] digits=[zero,one,zero,one,zero,one,zero,one,zero,one] inputted_digit=sys.argv[1]

Re: Plz comment on this code

2010-09-18 Thread Steven D'Aprano
On Sun, 19 Sep 2010 12:23:15 +1000, fridge wrote: # bigdigits2.py [snip code] It looks like Python. Did you have a specific question? P.S. Please don't send HTML to non-binary news groups, it's very annoying. And if you're sending it by email, your mail client appears to be broken, because