144
Here it is:
[chr(i) for i in range(128)]
ASCII defines 128 characters whose byte values range from 0 to 127 inclusive. So to get a string of all the ASCII characters, you could just do
''.join(chr(i) for i in range(128))
Only 100 of those are considered printable. The printable ASCII characters can be accessed via
import string
string.printable
Since ASCII printable characters are a pretty small list (bytes with values between 32 and 126 inclusive), it's easy enough to generate when you need:
>>> for c in (chr(i) for i in range(32, 127)):
... print(c)
...
!
"
#
$
%
... # a few lines removed :)
y
z
{
|
}
~