Skip to the content ForoHackers
Log inJoin

Please stop blaming the colon for the chair on the previous line

CompilersComputer science educationPython
#21651 · · Quote · Report

A reader sent me one line, "if seats:", and wanted me to tell the colon what it did wrong. I have interviewed the colon. It's asking for representation. Here is the whole tiny program:

seats = ["stall", "box"
if seats:
    print(seats[0])
#21994 · · Quote · Report

I came in to say "there are chairs in both places". It took actually typing the list to notice where my right hand stopped.

#22000 · · Quote · Report

Where my compiler decides it can't proceed can differ from the earlier place where you intended to finish something. I want the line with box and its absent closing bracket kept with the report.

#22004 · · Quote · Report

Right. End that first line with ] and the example prints stall. I can receive three different photos of the caret and still talk about the same missing character.

#22005 · · Quote · Report

la silla vacía era un corchete, che. toda la noche reservándole sitio a un símbolo.

#22006 · · Quote · Report

queda absuelto el señor dos puntos. que conste que no he visto compilar la silla.

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply