0

I would need to generate all non-alphabetic characters, punctuation, spaces, weird characters etc. Are they all those that appear in the ascii code or are there others? In python I should simply do:

''.join(map(lambda i: chr(i), range(255)))
gboffi
  • 22,939
  • 8
  • 54
  • 85
  • [string.punctuation](https://docs.python.org/3/library/string.html#string.punctuation) .. and other `string.xxxxx` members should help you out - for all printables use `string.printable` this avoids the charactercodes f.e. für the bell-sound which is not printable. same for ascii codes below 32 – Patrick Artner Nov 10 '20 at 11:37
  • 1
    python 3 uses utf-8 - so it can handle far more then the base 7-bit / 8-bit ascii set - and what characterrepesentations are exactly might also depend on the codepage you are using ... so ... good luck. – Patrick Artner Nov 10 '20 at 11:41
  • ASCII only has 1s on the 7 lsb, characters up to and including 127. – Jonas Byström Nov 10 '20 at 11:49
  • Even simpler: `''.join(map(chr, range(255)))`. But this includes a bunch of non-printable characters and 128 upper characters that are not comprised in the ASCII character set. – gboffi Nov 10 '20 at 14:46

1 Answers1

1

For an example of a non–ASCII non–alphabetic character, here it is the Ethiopic paragraph separator: ፨ — btw, there are three other different non–ascii non–alphabetic characters in this paragraph…

So no, the ASCII character set doesn't comprise every non–alphabetic character.

gboffi
  • 22,939
  • 8
  • 54
  • 85