> I wrote a function named vertical to print string .printable characters
and
.>> ASCII values in a table.
>> 1)It is swallowing some characters.
>> 2)It output some characters 2 or 3 times.
>> 3)It prints one column more than what I asked for.
>> def vertical(columns):
>> import string
>> v=string.printable
>> v=v.replace('\n','')
>> v=v.replace('\t','')
>What is len(v) here? What is len(v)/columns?
There are 100 characters in the string(string.printable)
I deleted '\n\t'. So 98/say 4==24.5 So if there is a fraction
I have to round it off to 1. So 24.5 should be rounded off
to 25..But is there a better way to print it in given number
of columns
>> for x in range((len(v))/columns):
>> for y in range(x,len(v),x+((len(v))/columns)):
>The third argument to range() is the step size. Do you want to use a
>different step size for each row?
No. How can I ensure that every value is an integer but without missing
in retrieving an element in the string.
Prasad
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor