Error while checking list element in an `if`
sts10 opened this issue · comments
In the playground, extending the list example:
-- Construct a new list.
list = [1, 2, 3]
-- The first element of the list starts at index 0.
print list[0] -- Prints '1'
-- check first element of list
if list[0] == 1:
print 'Success!'
I'd expect "Success!" to be printed, but the above throws the error:
ParseError: Block requires at least one statement. Use the `pass` statement as a placeholder.
main:8:2:
print 'Success!'
^
Don't think my if
statement is wrong, but it could be!
Previously, it didn't support tabs. Now you can use tabs or spaces but not both.
Ah, OK. So it was my if
statement!
I could see why you'd want to keep Cyber spaces-only, as a way to enforce a common style across projects / improve compatibility. I'd just say you need to tweak the playground to insert 4 spaces when a user hits the tab key (which is what I did in this example).