From 94d3519fc114b7dada3bd9cba062e1f18eac359d Mon Sep 17 00:00:00 2001 From: michel Date: Fri, 15 Nov 2019 11:47:59 +0100 Subject: [PATCH 1/5] update readme.md file --- readme.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index cf8da94..52b72f0 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,29 @@ -# Open Classroom Python TPs +# Open Classroom Python programming exercise (TPs) ## Python TPs from https://openclassrooms.com/en/courses/235344-apprenez-a-programmer-en-python -Implement all TPs from the above link +Implement all programming exercises (TPs) from the above link +## Description of content +### First programming exercise: leapyear.py (année bissextile) +This really simple implementation on a standalone file performs a quick leapyear check on any year entered by the user +Ex.: entry 1967 shows "l'année n'est pas bissextile", entry 1968 shows "l'annee est bissextile" +### Second programming exercise: Zcasino.py (simulation de roulette) +Still a standalone file, but implementation is slightly more sophisticated (but not yet advanced). +This python program simulates a (casino) roulette on which a player can bet some virtual $$$ on a number (between 0 and 49) and, either gain three times the amount (by chosing the winning number), either gain half the amount (by chosing the same colour) or loose the lot. +This file shows the use of randrange() function from random module and ceil() function from math module, also implements bloc sequences like: + try: + ... + assert ... + except ...: + pass + except ...: + pass + else: + ... +### Third programming exercise: donnees.py, fonctions.py and pendu.py (hangman game / jeu du pendu) +This exercice requiers some modular implementation based on the following file structure: +- pendu.y: Hangman game main module +- fonctions.py: Hangman game functions called in main module +- dnnees.py: Hangman game relevant data used in function or main module +This program simulates another game, the Hangman game (jeu du pendu), where the player is given 8 attempts to guess a word, randomly chosen from a predefined list. If no attempt left, the player has lost and is virtually hanged. +This implementation also handles a scores file, updating all the different player's scores on every game. +Usage of import statement, list operations, choice() from random module or pickle module is quite popular, here. + From 285416933b80c0f326cf4defda79230174b51283 Mon Sep 17 00:00:00 2001 From: michel Date: Fri, 15 Nov 2019 11:52:37 +0100 Subject: [PATCH 2/5] reshaped readme file --- readme.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 52b72f0..be26b12 100644 --- a/readme.md +++ b/readme.md @@ -1,14 +1,20 @@ # Open Classroom Python programming exercise (TPs) ## Python TPs from https://openclassrooms.com/en/courses/235344-apprenez-a-programmer-en-python Implement all programming exercises (TPs) from the above link + ## Description of content ### First programming exercise: leapyear.py (année bissextile) -This really simple implementation on a standalone file performs a quick leapyear check on any year entered by the user +This really simple implementation on a standalone file performs a quick leapyear check on any year entered by the user. + Ex.: entry 1967 shows "l'année n'est pas bissextile", entry 1968 shows "l'annee est bissextile" + ### Second programming exercise: Zcasino.py (simulation de roulette) Still a standalone file, but implementation is slightly more sophisticated (but not yet advanced). + This python program simulates a (casino) roulette on which a player can bet some virtual $$$ on a number (between 0 and 49) and, either gain three times the amount (by chosing the winning number), either gain half the amount (by chosing the same colour) or loose the lot. + This file shows the use of randrange() function from random module and ceil() function from math module, also implements bloc sequences like: + try: ... assert ... @@ -20,10 +26,14 @@ This file shows the use of randrange() function from random module and ceil() fu ... ### Third programming exercise: donnees.py, fonctions.py and pendu.py (hangman game / jeu du pendu) This exercice requiers some modular implementation based on the following file structure: + - pendu.y: Hangman game main module - fonctions.py: Hangman game functions called in main module - dnnees.py: Hangman game relevant data used in function or main module + This program simulates another game, the Hangman game (jeu du pendu), where the player is given 8 attempts to guess a word, randomly chosen from a predefined list. If no attempt left, the player has lost and is virtually hanged. + This implementation also handles a scores file, updating all the different player's scores on every game. + Usage of import statement, list operations, choice() from random module or pickle module is quite popular, here. From 630a17683487bcb803b17540c447c378e92d3122 Mon Sep 17 00:00:00 2001 From: michel Date: Fri, 15 Nov 2019 11:57:38 +0100 Subject: [PATCH 3/5] just few cosmetic fixes --- readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index be26b12..2505a16 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,7 @@ Implement all programming exercises (TPs) from the above link ### First programming exercise: leapyear.py (année bissextile) This really simple implementation on a standalone file performs a quick leapyear check on any year entered by the user. -Ex.: entry 1967 shows "l'année n'est pas bissextile", entry 1968 shows "l'annee est bissextile" +Ex.: entry 1967 shows "l'année n'est pas bissextile", entry 1968 shows "l'année est bissextile" ### Second programming exercise: Zcasino.py (simulation de roulette) Still a standalone file, but implementation is slightly more sophisticated (but not yet advanced). @@ -29,11 +29,11 @@ This exercice requiers some modular implementation based on the following file s - pendu.y: Hangman game main module - fonctions.py: Hangman game functions called in main module -- dnnees.py: Hangman game relevant data used in function or main module +- donnees.py: Hangman game relevant data used in function or main module This program simulates another game, the Hangman game (jeu du pendu), where the player is given 8 attempts to guess a word, randomly chosen from a predefined list. If no attempt left, the player has lost and is virtually hanged. This implementation also handles a scores file, updating all the different player's scores on every game. -Usage of import statement, list operations, choice() from random module or pickle module is quite popular, here. +Usage of import statements, list operations, choice() from random module or pickle module is quite popular, here. From de2b03f8e4221b5084c58f9194ca0504d1e9c64f Mon Sep 17 00:00:00 2001 From: michel Date: Fri, 15 Nov 2019 12:03:03 +0100 Subject: [PATCH 4/5] last cosmetics hopefully --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 2505a16..ebc4276 100644 --- a/readme.md +++ b/readme.md @@ -11,7 +11,7 @@ Ex.: entry 1967 shows "l'année n'est pas bissextile", entry 1968 shows "l'anné ### Second programming exercise: Zcasino.py (simulation de roulette) Still a standalone file, but implementation is slightly more sophisticated (but not yet advanced). -This python program simulates a (casino) roulette on which a player can bet some virtual $$$ on a number (between 0 and 49) and, either gain three times the amount (by chosing the winning number), either gain half the amount (by chosing the same colour) or loose the lot. +This python program simulates a (casino) roulette on which a player can bet some virtual $$$ on a number (between 0 and 49) and, either gain three times the amount (by chosing the winning number), either gain half the amount (by chosing the same colour, weither the number is odd or even) or loose the lot. This file shows the use of randrange() function from random module and ceil() function from math module, also implements bloc sequences like: @@ -27,7 +27,7 @@ This file shows the use of randrange() function from random module and ceil() fu ### Third programming exercise: donnees.py, fonctions.py and pendu.py (hangman game / jeu du pendu) This exercice requiers some modular implementation based on the following file structure: -- pendu.y: Hangman game main module +- pendu.py: Hangman game main module - fonctions.py: Hangman game functions called in main module - donnees.py: Hangman game relevant data used in function or main module From 8bb9e14f9e89fccfebb2219b9c9b8429dbb4d05f Mon Sep 17 00:00:00 2001 From: michel Date: Fri, 15 Nov 2019 15:15:12 +0100 Subject: [PATCH 5/5] reshaping, fixing, never ending --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index ebc4276..2370cc5 100644 --- a/readme.md +++ b/readme.md @@ -24,14 +24,14 @@ This file shows the use of randrange() function from random module and ceil() fu pass else: ... -### Third programming exercise: donnees.py, fonctions.py and pendu.py (hangman game / jeu du pendu) +### Third programming exercise: donnees.py, fonctions.py and pendu.py (jeu du pendu) This exercice requiers some modular implementation based on the following file structure: - pendu.py: Hangman game main module - fonctions.py: Hangman game functions called in main module - donnees.py: Hangman game relevant data used in function or main module -This program simulates another game, the Hangman game (jeu du pendu), where the player is given 8 attempts to guess a word, randomly chosen from a predefined list. If no attempt left, the player has lost and is virtually hanged. +This program implements another game, the Hangman game (jeu du pendu), where the player is given 8 attempts to guess a word, randomly chosen from a predefined list. If no attempt left, the player has lost and is virtually hanged. This implementation also handles a scores file, updating all the different player's scores on every game.