|
|
<!DOCTYPE html>
|
|
|
<html lang="en">
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
<title>Brython</title>
|
|
|
<link rel="stylesheet" href="../../CSS/enigme.css" />
|
|
|
</head>
|
|
|
<body>
|
|
|
<div>
|
|
|
|
|
|
</div>
|
|
|
<div class="enigme">
|
|
|
<h1>PALINDROME</h1><br>
|
|
|
<h2>Consigne</h2><br>
|
|
|
<p class="enonce">
|
|
|
Écrire une fonction estPalindrome qui prend en argument un entier et qui renvoie True si c’est un palindrome et False sinon.
|
|
|
</p><br><br>
|
|
|
<h2>Rappel</h2><br>
|
|
|
<p class="rappel">Un palindrome est un nombre qui peut se lire dans les deux sens. Par exemple 111.</p><br><br>
|
|
|
<h2>Exemple</h2><br>
|
|
|
<p>Entrée :      Sortie :</p>
|
|
|
<p>[1,0,1]        True</p>
|
|
|
<p>[1,1,9,1]       False</p><br><br>
|
|
|
<h2>Aide</h2><br>
|
|
|
<p>En python l’instruction [::-1] permet d’inverse une chaine de caractère. Par exemple print(\"ae\"[::-1]) affiche : ea.</p>
|
|
|
</div>
|
|
|
|
|
|
<h1 id="result" class="hidden"></h1>
|
|
|
|
|
|
<!-- <button onclick="run_init()">run</button>
|
|
|
<button onclick="submit()">submit</button>
|
|
|
<button onclick="aide()" id="buttonAide">Aide</button>
|
|
|
<button onclick="rappel()" id="buttonRappel">Rappel</button> -->
|
|
|
<p id="textAide"></p>
|
|
|
<p id="textRappel"></p>
|
|
|
<div class='editor_class' id='editor'>def estPalindrome(var):
|
|
|
if(var == var[::-1]):
|
|
|
return True
|
|
|
else:
|
|
|
return False
|
|
|
|
|
|
print(estPalindrome("abba"))</div>
|
|
|
<div class='compiler_class'>
|
|
|
<button id="hide" class="btn" onclick="hide()">X</button>
|
|
|
<textarea id='console' readonly rows="30" cols="100"></textarea>
|
|
|
<div class="buttons">
|
|
|
<div>
|
|
|
<button onclick="run_init()" class="btn">
|
|
|
<span>Run</span>
|
|
|
</button>
|
|
|
<button onclick="submit()" class="btn">
|
|
|
<span>Submit</span>
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script src="https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<script src="https://raw.githack.com/pythonpad/brython-runner/master/lib/brython-runner.bundle.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<script src="../../JS/base.js"></script>
|
|
|
<script src="../../JS/palindrome.js"></script>
|
|
|
</body>
|
|
|
</html>
|