4 ms·
No need for braces. Just add "end" for marking block ending to match the already block starting keyword ":".
by mg74 2y ago
No need for braces. Just add "end" for marking block ending to match the already block starting keyword ":".
- pansa2 2y agoA while ago, when thinking about syntax design for a new language, I considered this combination (`:` and `end`, as opposed to `do` and `end` as used by Lua etc). Are there any languages that use it, or is Python unique in using `:` to begin a block?
- dbrueck 2y agoNim uses it too. IIRC, Python's predecessor (ABC) didn't have the trailing colon but they did some experiments and found it increased readability.