NSI
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
L
LESAINT Cyprien
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lesaint Cyprien
LESAINT Cyprien
Commits
1a2362bd
Commit
1a2362bd
authored
Mar 24, 2025
by
Lesaint Cyprien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
04406112
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
sujet_12.py
sujet_12.py
+34
-0
No files found.
sujet_12.py
0 → 100644
View file @
1a2362bd
def
tri_selection
(
tab
):
n
=
len
(
tab
)
for
i
in
range
(
n
-
1
):
min
=
i
for
j
in
range
(
i
+
1
,
n
):
if
tab
[
j
]
<
tab
[
min
]:
min
=
j
tab
[
i
],
tab
[
min
]
=
tab
[
min
],
tab
[
i
]
from
random
import
randint
def
plus_ou_moins
():
nb_mystere
=
randint
(
1
,
99
)
nb_test
=
int
(
input
(
"Proposez un nombre entre 1 et 99 : "
))
compteur
=
1
while
nb_test
!=
nb_mystere
and
compteur
<
10
:
compteur
=
compteur
+
1
if
nb_mystere
>
nb_test
:
nb_test
=
int
(
input
(
"Trop petit ! Testez encore : "
))
else
:
nb_test
=
int
(
input
(
"Trop grand ! Testez encore : "
))
compteur
+=
1
if
nb_test
==
nb_mystere
:
print
(
"Bravo ! Le nombre était "
nb_mystere
)
print
(
"Nombre d'essais :"
compteur
)
else
:
print
(
"Perdu ! Le nombre était"
nb_mystere
)
\ No newline at end of file
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