square brackets in python? | Sololearn: Learn to code for FREE!


square brackets in python?

Hi, I'm just starting learning python in these days and I see in the challenges that a lot of codes contain something like [1] or [0] or more generally I don't understand what are them used for

4/7/2018 5:38:25 PM

luca D'este

2 Answers

New Answer




List are a structure data type in python,like tuple,set ,string,and dictionnary.Square brackets indicates that we use a list.To create a list give it a variable name and assign it to a collection of data separated by comma inside square brackets. a = [1,2,"fg",6]