- 1. Entrée, impression et numéros
- 2. Numéros entiers et flottants
- 3. Conditions: si-alors-autrement
- 4. Pour boucle avec plage
- 5. Cordes
- 6. Boucle en boucle
- 7. Listes
- 8. Fonctions et récursivité
- 9. Listes bidimensionnelles (tableaux)
- 10. Ensembles
- 11. Dictionnaires
- 12. JavaScript
- 13. HTML5 and CSS
- 14. Responsive Design with Bootstrap
- 15. jQuery
Ad place
Even indices
Statement
Given a list of numbers, find and print all the list elements with an even index number. (i.e.A[0]
, A[2]
, A[4]
, ...).
Advertising by Google, may be based on your interests
In all the problems input the data using input()
and print the result using print()
.
12# Read an integer:# a = int(input())XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Input:
11 2 3 4 5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output:
1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Saved solutions
Tests
Input | Correct answer | |
---|---|---|
1 2 3 4 5 | 1 3 5 | |
4 5 3 4 2 3 | 4 3 2 | |
9 4 5 2 3 | 9 5 3 | |
6 | 6 | |
7 8 | 7 | |
1 2 3 | 1 3 | |
90 45 3 43 | 90 3 | |
40 64 -80 -98 -68 56 85 87 -68 -78 | 40 -80 -68 85 -68 | |
-1 -11 -40 3 -47 -37 -18 -100 6 -29 14 -1 -89 -20 -36 7 5 78 -5 85 | -1 -40 -47 -18 6 14 -89 -36 5 -5 |