Sujet : Re: Why a time of the real world must be galilean (space-contraction)
De : me (at) *nospam* pla.net.invalid (robby)
Groupes : fr.sci.mathsDate : 05. Jan 2025, 12:00:41
Autres entêtes
Organisation : Nemoweb
Message-ID : <ZIpNXl5vsALmYe5butkf62NoG9M@jntp>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Nemo/1.0
Le 05/01/2025 à 11:14, Dominique a écrit :
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')
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).
-- Fabrice