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
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}")
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)
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.
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 .