Do commas count as items in lists? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Do commas count as items in lists?

29th May 2020, 2:00 AM
Fresh
3 Answers
+ 2
No
29th May 2020, 2:04 AM
Tarun Kumar
Tarun Kumar - avatar
+ 1
--->Generally it doesn't count but commas between string is displayable and ---> if you wanna append commas in list then you can. by using this command ---> List.append(",") ---> Then this appended comma is countable as list string
1st Jun 2020, 12:44 PM
PLAY WITH CODE
PLAY WITH CODE - avatar
0
Commas do not count as items in a list. If you need to add a comma as a string item in a list you can separate it with a comma: listy = [“Not Comma”, “,”, “Not Comma”]
29th May 2020, 2:08 AM
Runcible