France ioi mine visit
Solved
smokekevin46
Posted messages
19
Status
Member
-
jee pee Posted messages 31964 Registration date Status Moderator Last intervention -
jee pee Posted messages 31964 Registration date Status Moderator Last intervention -
Bonjour,
Here is the exercise I need to complete in Python, I've been working on it for a long time and I'm having some difficulties, could you please help me? Thank you
####
There are 5 types of movements, represented by 5 different integers: move left (1), move right (2), move straight (3), go up (4) and go down (5).
The first integer to read is the total number of movements (maximum 1000). Then, each movement (represented by an integer) is provided on its own line.
You need to display the sequence of movements to go from your current position to the exit.
Example
input:
6
1
3
2
4
4
5
output:
4
5
5
1
3
2
######
My program is as follows:
The error message indicates:
File "exe", line 6
for numero in range(nbDeplacements-1,-1,-1)
^
SyntaxError: invalid syntax
Here is the exercise I need to complete in Python, I've been working on it for a long time and I'm having some difficulties, could you please help me? Thank you
####
There are 5 types of movements, represented by 5 different integers: move left (1), move right (2), move straight (3), go up (4) and go down (5).
The first integer to read is the total number of movements (maximum 1000). Then, each movement (represented by an integer) is provided on its own line.
You need to display the sequence of movements to go from your current position to the exit.
Example
input:
6
1
3
2
4
4
5
output:
4
5
5
1
3
2
######
My program is as follows:
deplacementInverse = [0, 2, 1, 3, 5, 4] nbDeplacements = int(input()) chemin= [0] * nbDeplacements for numero in range(nbDeplacements): chemin[numero] = int(input()) for numero in range(nbDeplacements-1,-1,-1) print(deplacementInverse[numero])
The error message indicates:
File "exe", line 6
for numero in range(nbDeplacements-1,-1,-1)
^
SyntaxError: invalid syntax