Re: Why a time of the real world must be galilean (space-contraction)

Liste des GroupesRevenir à fs maths 
Sujet : Re: Why a time of the real world must be galilean (space-contraction)
De : jp (at) *nospam* python.invalid (Python)
Groupes : fr.sci.maths
Date : 05. Jan 2025, 22:20:22
Autres entêtes
Organisation : Nemoweb
Message-ID : <rs6Smpf-wJ16dtXOpaX7VI1jFCg@jntp>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Nemo/1.0
Le 05/01/2025 à 18:03, Dominique a écrit :
Le 05/01/2025 à 12:00, robby a écrit :
 
comment ça se fait que ça affiche
   ('Carre de ', 10, ' donne ', '100', ' soit', 10, '+', 0, ' OK')
au lieu de   Carre de 10 donne 100 soit 10 + 0 OK ?
(je ne connais pas python. j'ai aussi du enlever le é dont l'encoding empêchait l'exécution).
 Euh, je ne sais pas. J'ai un affichage correct sans apostrophes intempestives :
Robby a exécuté un programme en Python 3 en Python 3, c'est tout.
En Python 2 (sauf si "from __future__ import print_function") print est une instruction et pas une fonction. Donc "print (...)" affiche le tuple défini par "(...)". En P3 la fonction print affiche ses arguments séparés (par défaut) par une espace et ajoute un saut de ligne (par défaut).

Carré de  10  donne  100  soit 10 + 0  OK
 Quant à l'encodage, il est fixé en utf8 dans les premières lignes du script que je n'ai pas indiquées (à tort). Voici le script complet, y compris les deux lignes de déclarations au début (ce qui est entre les *** est ignoré. C'est du commentaire) :
La spécification de l'encodage était obligatoire en Python 2 dès lors qu'on sortait de ASCII 7 bits, ne serait-ce que pour un commentaire. En Python 3 la spécification de l'encodage est optionnelle et utf-8 est supposé en l'absence d'annotations.

Date Sujet#  Auteur
16 Dec 24 * Re: Why a time of the real world must be galilean (space-contraction)16Richard Hachel
19 Dec 24 +- Re: Why a time of the real world must be galilean (space-contraction)1Python
5 Jan 25 `* Re: Why a time of the real world must be galilean (space-contraction)14Dominique
5 Jan 25  `* Re: Why a time of the real world must be galilean (space-contraction)13Dominique
5 Jan 25   `* Re: Why a time of the real world must be galilean (space-contraction)12Dominique
5 Jan 25    `* Re: Why a time of the real world must be galilean (space-contraction)11robby
5 Jan 25     +* Re: Why a time of the real world must be galilean (space-contraction)2Python
7 Jan 25     i`- Re: Why a time of the real world must be galilean (space-contraction)1robby
5 Jan 25     +- Re: Why a time of the real world must be galilean (space-contraction)1Thomas Alexandre
5 Jan 25     +* Re: Why a time of the real world must be galilean (space-contraction)3Dominique
5 Jan 25     i`* Re: Why a time of the real world must be galilean (space-contraction)2Python
6 Jan 25     i `- Re: Why a time of the real world must be galilean (space-contraction)1Dominique
5 Jan 25     `* Re: Why a time of the real world must be galilean (space-contraction)4Michel Talon
5 Jan 25      +* Re: Why a time of the real world must be galilean (space-contraction)2efji
6 Jan 25      i`- Re: Why a time of the real world must be galilean (space-contraction)1Dominique
7 Jan 25      `- Re: Why a time of the real world must be galilean (space-contraction)1robby

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal