Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Rechercher et remplacer

TOTO = list(range(1, 5))
TOTO2 = list(range(1, 10))
for bipblop in TOTO:
    print("table de ", TOTO[bipblop - 1], " :")
    for secondo in TOTO2:
        print(
            str(TOTO[bipblop - 1]),
            " x ",
            str(TOTO2[secondo - 1]),
            " = ",
            (TOTO[bipblop - 1] * TOTO2[secondo - 1]),
        )
    print("----------------")
table de  1  :
1  x  1  =  1
1  x  2  =  2
1  x  3  =  3
1  x  4  =  4
1  x  5  =  5
1  x  6  =  6
1  x  7  =  7
1  x  8  =  8
1  x  9  =  9
----------------
table de  2  :
2  x  1  =  2
2  x  2  =  4
2  x  3  =  6
2  x  4  =  8
2  x  5  =  10
2  x  6  =  12
2  x  7  =  14
2  x  8  =  16
2  x  9  =  18
----------------
table de  3  :
3  x  1  =  3
3  x  2  =  6
3  x  3  =  9
3  x  4  =  12
3  x  5  =  15
3  x  6  =  18
3  x  7  =  21
3  x  8  =  24
3  x  9  =  27
----------------
table de  4  :
4  x  1  =  4
4  x  2  =  8
4  x  3  =  12
4  x  4  =  16
4  x  5  =  20
4  x  6  =  24
4  x  7  =  28
4  x  8  =  32
4  x  9  =  36
----------------

Bilan

La fonction rechercher et remplacer vous permet de changer facilement le nom d’une variable dans tous le carnet sans la modifier à la main une par une. Cela évite des erreurs de frappes, et des oublis.