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 : dominique.sextant (at) *nospam* orange.fr.invalid (Dominique)
Groupes : fr.sci.maths
Date : 05. Jan 2025, 18:03:29
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vlee14$14ei4$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Mozilla Thunderbird
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 :
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) :
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan  5 11:15:21 2025
https://www.facebook.com/Bee.Ccreative/videos/934428615228799
@author:
"""
for i in range (10,10000):
     t=str(i**2)
     #if len(t)%2==1:
     m1=int(len(t)/2)
     m2=m1+1
     #m=int(len(t)/2)
     t1=int(t[:m1])
     t2=int(t[m1:])
     t3=int(t[:m2])
     t4=int(t[m2:])
     if t1+t2==i:
         print('Carré de ',i,' donne ',t,' soit',t1,'+',t2,' OK')
     if t3+t4==i:
         print('Carré de ',i,' donne ',t,' soit',t3,'+',t4,' OK')
Tu peux tester avec ton encodage à toi (https://dnmtechs.com/understanding-the-coding-utf-8-declaration-in-python-3/) Je vais avoir du mal à aller plus loin : je suis sous Linux et je ne connais ni Microsoft ni Mac.
--
Dominique
Esto quod es

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