+ 1

How and when do you use the colom?

8th Sep 2020, 6:14 PM
D-MON
D-MON - avatar
5 Answers
+ 14
and don't forget the walrus operator :=
8th Sep 2020, 7:10 PM
Jan Markus
+ 9
colon is used with -> if...: ... elif...: ... else: ... ---- try...: ... except...: ... ---- while ...: ---- for ...: ---- def my_func(...): (defining user functions) ... ---- class Coordinates(): (defining a class) ... ---- After each colon, next line has to be indented, except the following case -> ---- Colon is also used with slices -> inp[3:10] ---- creating dictionary to separate key : values
8th Sep 2020, 6:29 PM
Lothar
Lothar - avatar
+ 5
Conditions, loops, dictionaries, some arguments require them too
8th Sep 2020, 6:18 PM
Steven M
Steven M - avatar
+ 4
Oh and don't forget Lambdas 😉
8th Sep 2020, 6:40 PM
Steven M
Steven M - avatar
+ 4
Collecting things in common is called swarm intelligence. đŸ˜‚đŸ˜‚đŸ€Ł
9th Sep 2020, 12:20 PM
Lothar
Lothar - avatar