Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ascii question
#2
You can use a triple quoted string
>>> SYMBOLS = """abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
>>> 
>>> SYMBOLS
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
Also for a better looking code, use lexical string concatenation
>>> SYMBOLS = (
...     """abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"""
...     """!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~""")
Reply


Messages In This Thread
ascii question - by DPaul - Aug-20-2021, 09:07 AM
RE: ascii question - by Gribouillis - Aug-20-2021, 09:27 AM
RE: ascii question - by snippsat - Aug-20-2021, 09:56 AM
RE: ascii question - by Larz60+ - Aug-20-2021, 10:11 AM
RE: ascii question - by DPaul - Aug-20-2021, 04:07 PM
RE: ascii question - by Yoriz - Aug-20-2021, 04:19 PM
RE: ascii question - by DPaul - Aug-20-2021, 05:32 PM
RE: ascii question - by naughtyCat - Aug-21-2021, 01:47 PM
RE: ascii question - by perfringo - Aug-21-2021, 05:50 PM
RE: ascii question - by Yoriz - Aug-21-2021, 05:58 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020