Exercise 4
Write a Python algorithm that asks the user to enter 5 integers of their choice and displays the list of numbers entered.
Solution
1 2 3 4 5 6 7 8 |
# initialize the list of numbers to enter listNumbers = [] for i in range(0 , 5): n = int(input("Type the value of an integer: ")) # add the number n to the list listNumbers.append(n) # Display the list of entered numbers: print("Here is the list of numbers entered: ", listNumbers) |
Younes Derfoufi
CRMEF OUJDA
Acheter sur Très Facile !
-
Langage Python pour les Nuls, 3e éd - John Paul Mueller
€ 24,00 Acheter le livre -
Ouvrage de Référence Python : Exploration Approfondie du Langage Python
€ 42,00 Acheter le livre -
Routeur Tenda avec Carte SIM 4G09 AC1200 Bi- bandd 4G + Cat6 300Mbps, Connectivité Jusqu'à 64 Appareils
€ 89,00 Acheter le produit
1 thought on “Solution Exercise 4: python algorithm that displays the list of numbers entered by the user”