Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
python-uga
py-training-2017
Commits
eb352627
Commit
eb352627
authored
Dec 13, 2021
by
Mathieu Istas
Browse files
corrected exercice finding missing element in list
parent
0eed487f
Pipeline
#83738
passed with stage
in 1 minute and 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ipynb/pres02_basic_statements.ipynb
View file @
eb352627
...
...
@@ -1140,10 +1140,12 @@
```
python
from random import shuffle, randint
n = 20
i = randint(0, n-1)
# i = 19 #special case for testing, element at the end of the list
print('integer remove from the list:', i)
l = list(range(n))
l.remove(i)
shuffle(l)
print('shuffled list: ', l)
...
...
@@ -1172,11 +1174,11 @@
if elem != idx:
found = idx
break
if found is None:
found = len(l)
print("missing ",
idx
)
print("missing ",
found
)
```
%% Cell type:code id: tags:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment