Re:Stack Overflow: Printing 1 to 1000 in C
by kroo on Monday March 14, 2011 @04:27PM
(#2324260)
no! For one thing, it still prints out an opening '[' before 1. Second of all, relying on the structure of the string representation of an array is just silly. Perhaps:
or
[ Parent
| on HN ]
Re:Stack Overflow: Printing 1 to 1000 in C
by rararational on Monday March 14, 2011 @04:42PM
(#2324350)
Heh, I forgot about join but that for is still a loop right? :)
Or else you could just:
for i in range(1,1000):
print i
Plus relying on the string representation of a list isn't silly it as it doesn't change. I just didn't know if range would meet the criteria or not.