Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Dominique <dominique.sextant@orange.fr.invalid> Newsgroups: fr.sci.maths Subject: Re: Why a time of the real world must be galilean (space-contraction) Date: Sun, 5 Jan 2025 18:03:29 +0100 Organization: A noiseless patient Spider Lines: 51 Message-ID: <vlee14$14ei4$1@dont-email.me> References: <180f1778e64eec8d$354$1238888$c2365abb@news.newsdemon.com> <181050bd5e899136$3636$1228337$c2265aab@news.newsdemon.com> <gS3CnAvH7iZAR8z2fpZ16WpwAQI@jntp> <181154a9986e9f2f$4267$1238888$c2365abb@news.newsdemon.com> <LKudnak0JLYu1sL6nZ2dnZfqn_ednZ2d@giganews.com> <3mKMfwgJtRfN4V1gGsy4VLJ6a64@jntp> <lqBFOj-jmrn9yhAKRF22SfRFA68@jntp> <vld25h$sc0g$1@dont-email.me> <vldlqf$vkj0$1@dont-email.me> <vldm1o$vkj0$2@dont-email.me> <ZIpNXl5vsALmYe5butkf62NoG9M@jntp> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 05 Jan 2025 18:03:33 +0100 (CET) Injection-Info: dont-email.me; posting-host="17382093f1197b2108204f65e4b5fd49"; logging-data="1194564"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kckZ7XvGAQTsSN/kSfiP/7AbdrsYFcek=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:oJRUo4Dd+ZVye9TNczJLUPj2oJE= In-Reply-To: <ZIpNXl5vsALmYe5butkf62NoG9M@jntp> Content-Language: fr Bytes: 3029 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