How do you do dot points?

Hey I was just wondering on the best way to make unnumbered dot points in python… I know how to make lists but I am unsure on how to make dot points.
eg.

#lists
my_list = [apple, banana, carrot]

But I just don’t know how to do dot points.
If someone can help me out with this it would be much obliged, Thanks

(preferable without importing anything)

What does “dot points” mean?

its bullet point… does no one call them dot points??
(I’m from Australia)

eg.

  • one apple
  • two apples

If you mean “store them as bullet points” I think that make little sense in Python as you’re referring to a way to output a list. This can be done by formatting the output, for example

for item in ['this', 'that', 'something else']:
    print(f". {item}")
1 Like

If you’re wondering how to get Python to print actual bullet points, then doing a general search for “unicode bullet point” brings up links like Bullet (typography) - Wikipedia

From there, you can copy the character directly into your source code and use it when printing out the other text:

for item in ['this', 'that', 'something else']:
    print(f"• {item}")

Note the difference between the Unicode here and the ASCII . in @avisser’s example.

Searching for “unicode <symbol name or description>” is a general trick for this kind of problem (e.g. the results for “unicode right pointing arrow” include a link to Arrow (symbol) - Wikipedia where there are many potential arrow symbols to choose from in cases where -> isn’t an adequate substitute)

1 Like

Another case of “Two nations seperated by a common language”?

2 Likes

Alternatively, if you remember the Unicode name of the character, use the \N escape sequence.

>>> "\N{BULLET}" == "•"
True
1 Like

Thanks, I couldn’t figure out how to make dot points for the life of me :rofl:

Sorry I’m new to programming… what do you mean by ‘Unicode’ ??

By ‘Unicode’, I mean the text encoding standard Unicode - Wikipedia.

And by ‘Unicode name’, I mean the name of the symbol in the Unicode database.
You will usually find the Unicode name along with the character when you search for it.

Or you can use unicodedata.name to find out.

For some nice background on Unicode (as well as character sets and text encodings in general), I usually recommend this blog post:

The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets

For a deeper dive, you can try skimming the first few sections of the Unicode standard itself. The Introduction and General Structure sections cover basically everything you’d need to know in practice, and are pretty short and surprisingly readable :wink:.

2 Likes

Thanks I will have a read :smiling_face: