what does the colon mean?? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

what does the colon mean??

what does the colon(:) mean in python?

30th Apr 2018, 1:54 PM
spe
spe - avatar
2 Respostas
+ 2
Its used for many things... defining functions, classes, loop, branches (ifs) and collection slicing. I probably missed out a few.
30th Apr 2018, 3:14 PM
TurtleShell
TurtleShell - avatar
0
The colon tells the computer to expect whitespace on the next n lines where n is the number of lines to be indented. Since python uses whitespace instead of curly brackets, whitespace is used.
30th Apr 2018, 3:31 PM
Astutewinter
Astutewinter - avatar