[pyar] [Consulta] Programacion: Inserting Comma Separators

j0hn j0hn.com.ar en gmail.com
Jue Mar 15 21:48:31 ART 2012


2012/3/15 Matías Bellone <matiasbellone en gmail.com>

> On Thu, Mar 15, 2012 at 6:12 PM, DF-- <dj.foguelman en gmail.com> wrote:
> >
> >
> > 2012/3/12 Claudio Freire <klaussfreire en gmail.com>
> >>
> >> print no es una función en python2 y por lo tanto no puede recibir un
> >> parámetro (por keyword o no).
> >
> >
> > $ python
> > Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
> > [GCC 4.4.3] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> print("esto anda")
> > esto anda
> >
> > No entiendo.
> >
>
> Porque eso es syntactic sugar. Tratá de hacer lo que querían hacer en
> el mensaje original:
>
> Python 2.7.2+ (default, Dec  1 2011, 01:55:02)
> [GCC 4.6.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> print("hola")
> hola
> >>> print("hola", ",")
> ('hola', ',')
> >>> print("hola", sep=",")
>  File "<stdin>", line 1
>    print("hola", sep=",")
>                     ^
> SyntaxError: invalid syntax
>
> Saludos,
> Toote
> _______________________________________________
> pyar mailing list pyar en python.org.ar
> http://listas.python.org.ar/listinfo/pyar
>
> PyAr - Python Argentina - Sitio web: http://www.python.org.ar/
>
> La lista de PyAr esta Hosteada en USLA - Usuarios de Software Libre de
> Argentina - http://www.usla.org.ar
>


También se puede ver haciendo esto:

Python* 2.7.2* (default, Jan 31 2012, 13:26:35)
[GCC 4.6.2 20120120 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> type(print)
  File "<stdin>", line 1
    type(print)
             ^
SyntaxError: invalid syntax
>>>

Python *3.2.2* (default, Nov 21 2011, 16:51:01)
[GCC 4.6.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> type(print)
<class 'builtin_function_or_method'>
>>>
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20120315/3d3c274b/attachment.html>


More information about the pyar mailing list