Saltar al contenido ForoHackers

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

CompiladoresEnseñanza de la informáticaPython
#21651 · · Citar · Denunciar

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 · · Citar · Denunciar

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 · · Citar · Denunciar

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 · · Citar · Denunciar

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 · · Citar · Denunciar

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

#22006 · · Citar · Denunciar

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

No has iniciado sesión, así que esto se publica como anónimo: no se guarda con ello ninguna cuenta, nombre ni dirección, y no puede llevar enlaces ni imágenes. Inicia sesión o únete para publicar con tu nombre. Los registros de nuestro servidor web guardan la dirección y la hora de cada petición hasta 14 días; para que la tuya no quede en ellos, usa Tor. Para escribir al equipo de forma confidencial, usa el buzón. Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder