Exemple de pratique Python 34
Sujet :Pratique des appels de fonctions.
Analyse du programme :Utiliser une fonction pour afficher trois foisEXEMPLEla chaîne.
Exemple
#!/usr/bin/python
# -*- coding: UTF-8 -*-
def hello_example():
print ('EXEMPLE')
def hello_examples():
for i in range(3):
hello_example()
if __name__ == '__main__':
hello_examples()
La sortie de l'exemple ci-dessus est :
EXAMPLE EXAMPLE EXAMPLEAutres extensions
100 exemples Python