diff --git a/fr-FR/code/complete/main.py b/fr-FR/code/complete/main.py new file mode 100644 index 0000000..9c1d7a8 --- /dev/null +++ b/fr-FR/code/complete/main.py @@ -0,0 +1,25 @@ +# imports +from datetime import datetime +from random import randint + +monde = '🌍🌎🌏' +python = 'Python 🐍' +feu = '🔥' + +# Définitions de fonctions +def roule_de(): + max = input('Combien de faces y a-t-il sur ton dé ?') + print(f'C\'est un D {max}') + roule = randint(1, int(max)) + print(f'Tu as obtenu un {roule} {feu * roule}') + +# Mettre le code à exécuter ci-dessous +print(f'Bonjour {monde}') +print(f'Bienvenue sur {python}') +print(f'{python} est bon en maths !') +print(f'{111111111 * 111111111}') +print(f'La date et l'heure sont {datetime.now()}') +roule_de() # Appel la fonction lancer de dés +print(f'J\'❤️ ...') +print(f'... me rend 😃') +print(f'Je voudrais faire ... avec {python}') diff --git a/fr-FR/code/complete/project_config.yml b/fr-FR/code/complete/project_config.yml new file mode 100644 index 0000000..d64ad3a --- /dev/null +++ b/fr-FR/code/complete/project_config.yml @@ -0,0 +1,3 @@ +name: "Bonjour 🌍🌎🌏" +identifier: "editor-hello-world-complete" +type: 'python' diff --git a/fr-FR/code/starter/main.py b/fr-FR/code/starter/main.py new file mode 100644 index 0000000..159f9d3 --- /dev/null +++ b/fr-FR/code/starter/main.py @@ -0,0 +1,11 @@ +# imports + +# variables +world = '🌍🌎🌏' +python = 'Python 🐍' +fire = '🔥' + +# Function definitions + +# Put code to run under here + diff --git a/fr-FR/code/starter/project_config.yml b/fr-FR/code/starter/project_config.yml new file mode 100644 index 0000000..d3e3158 --- /dev/null +++ b/fr-FR/code/starter/project_config.yml @@ -0,0 +1,3 @@ +name: "Bonjour 🌍🌎🌏" +identifier: "editor-hello-world-starter" +type: 'python' diff --git a/fr-FR/images/banner.png b/fr-FR/images/banner.png new file mode 100644 index 0000000..a6bd889 Binary files /dev/null and b/fr-FR/images/banner.png differ diff --git a/fr-FR/images/blue-points.png b/fr-FR/images/blue-points.png new file mode 100644 index 0000000..5768422 Binary files /dev/null and b/fr-FR/images/blue-points.png differ diff --git a/fr-FR/images/comma_error.png b/fr-FR/images/comma_error.png new file mode 100644 index 0000000..224bfe7 Binary files /dev/null and b/fr-FR/images/comma_error.png differ diff --git a/fr-FR/images/full_screen.png b/fr-FR/images/full_screen.png new file mode 100644 index 0000000..b45cc1f Binary files /dev/null and b/fr-FR/images/full_screen.png differ diff --git a/fr-FR/images/hello_error.png b/fr-FR/images/hello_error.png new file mode 100644 index 0000000..32d2a38 Binary files /dev/null and b/fr-FR/images/hello_error.png differ diff --git a/fr-FR/images/indent_error.png b/fr-FR/images/indent_error.png new file mode 100644 index 0000000..9874040 Binary files /dev/null and b/fr-FR/images/indent_error.png differ diff --git a/fr-FR/images/quiz1.png b/fr-FR/images/quiz1.png new file mode 100644 index 0000000..f08c165 Binary files /dev/null and b/fr-FR/images/quiz1.png differ diff --git a/fr-FR/images/quiz2.png b/fr-FR/images/quiz2.png new file mode 100644 index 0000000..987273a Binary files /dev/null and b/fr-FR/images/quiz2.png differ diff --git a/fr-FR/images/quiz3.png b/fr-FR/images/quiz3.png new file mode 100644 index 0000000..b38b472 Binary files /dev/null and b/fr-FR/images/quiz3.png differ diff --git a/fr-FR/images/roll_dice.png b/fr-FR/images/roll_dice.png new file mode 100644 index 0000000..4c274da Binary files /dev/null and b/fr-FR/images/roll_dice.png differ diff --git a/fr-FR/images/run_hello.png b/fr-FR/images/run_hello.png new file mode 100644 index 0000000..c89c369 Binary files /dev/null and b/fr-FR/images/run_hello.png differ diff --git a/fr-FR/images/run_hello_world.png b/fr-FR/images/run_hello_world.png new file mode 100644 index 0000000..653543c Binary files /dev/null and b/fr-FR/images/run_hello_world.png differ diff --git a/fr-FR/images/run_multiple.png b/fr-FR/images/run_multiple.png new file mode 100644 index 0000000..e1b8aa7 Binary files /dev/null and b/fr-FR/images/run_multiple.png differ diff --git a/fr-FR/images/say_hello.png b/fr-FR/images/say_hello.png new file mode 100644 index 0000000..e1b8aa7 Binary files /dev/null and b/fr-FR/images/say_hello.png differ diff --git a/fr-FR/images/sentence_starter.png b/fr-FR/images/sentence_starter.png new file mode 100644 index 0000000..c3d9b67 Binary files /dev/null and b/fr-FR/images/sentence_starter.png differ diff --git a/fr-FR/images/showcase_static.png b/fr-FR/images/showcase_static.png new file mode 100644 index 0000000..196c0cb Binary files /dev/null and b/fr-FR/images/showcase_static.png differ diff --git a/fr-FR/images/starter_project.png b/fr-FR/images/starter_project.png new file mode 100644 index 0000000..cc90493 Binary files /dev/null and b/fr-FR/images/starter_project.png differ diff --git a/fr-FR/images/sums_dates.png b/fr-FR/images/sums_dates.png new file mode 100644 index 0000000..574bc1f Binary files /dev/null and b/fr-FR/images/sums_dates.png differ diff --git a/fr-FR/images/upgrade_ideas.png b/fr-FR/images/upgrade_ideas.png new file mode 100644 index 0000000..53bcd64 Binary files /dev/null and b/fr-FR/images/upgrade_ideas.png differ diff --git a/fr-FR/meta.yml b/fr-FR/meta.yml new file mode 100644 index 0000000..e3e2630 --- /dev/null +++ b/fr-FR/meta.yml @@ -0,0 +1,57 @@ +title: "Editeur Bonjour \U0001F30D\U0001F30E\U0001F30F" +hero_image: images/banner.png +description: Écris un projet Python interactif qui utilise des emojis +meta_title: Projets de codage Python pour enfants et adolescent·e·s | Bonjour le monde +meta_description: Apprends Python avec la Raspberry Pi Foundation. Crée un projet de codage Python interactif qui utilise des emojis. +version: 4 +listed: false +copyedit: false +last_tested: "2021-10-06" +steps: + - + title: step 1 + - + title: step 2 + completion: + - engaged + - + title: step 3 + - + title: step 4 + - + title: step 5 + - + title: step 6 + - + title: step 7 + - + title: step 8 + - + title: step 9 + - + title: step 10 + - + title: step 11 + - + title: step 12 + - + title: step 13 + - + title: step 14 + - + title: step 15 + - + title: step 16 + completion: + - internal + - + title: step 17 + knowledge_quiz: + path: quiz1 + version: 1 + questions: 3 + passing_score: 3 + - + title: step 18 + completion: + - external diff --git a/fr-FR/python-comments.txt b/fr-FR/python-comments.txt new file mode 100644 index 0000000..0d82660 --- /dev/null +++ b/fr-FR/python-comments.txt @@ -0,0 +1,43 @@ +Mettre le code à exécuter ci-dessous + +Imprimer le résultat de la somme + +Imprimer avec l'emoji + +Mettre les définitions des fonctions ici + +Ne pas oublier les deux points à la fin de cette ligne + +Appelle la fonction roule_de + +Générer un nombre aléatoire entre 1 et 6 + +Imprimer la valeur de la variable roule + +Répéter l'emoji de feu pour correspondre au lancer de dés + +Attendre l'entrée de l'utilisateur + +Utiliser le numéro que l'utilisateur a saisi + +randint a besoin que max soit un 'entier' + +Attendre que l'utilisateur appuie sur Entrée + +Caractères utiles : ',()*_/.# + +Variables Emoji à utiliser dans ton projet + +Ajouter des alternatives d'art ASCII + +Avant les emojis, nous utilisions des émoticônes faites à partir de caractères + +obtenir l'entrée de l'utilisateur + +générer un nombre aléatoire + +répéter le texte feu plusieurs fois + +obtenir la date et l'heure actuelles + +Appeler la fonction hobbies diff --git a/fr-FR/python-translatable.txt b/fr-FR/python-translatable.txt new file mode 100644 index 0000000..f970ae5 --- /dev/null +++ b/fr-FR/python-translatable.txt @@ -0,0 +1,101 @@ +Bonjour + +Bienvenue à ... + +...est très doué pour... + +Le ... est + +...peut faire un... + +Tu as obtenu un ... + +Combien de côtés ? + +C\'est un D ... + +J\'<3 ... + +... me rend ... + +Je voudrais faire ... avec ... + +fantastique + +Je peux coder + +deux_des + +Premier nombre : + +Deuxième nombre : + +hobbies + +hobby + +Qu\'aimes-tu ? + +Cela a l'air ... + +Tu pourrais faire un ... projet sur ... + +roule_de + +roule + +maintenant + +monde + +sommes + +calendrier + +horloge + +projets + +amusant + +dé + +licorne + +espace + +heureux + +idiot + +cœur + +jeux + +livres + +sports + +vert + +nature + +feu + +étincelles + +implorer + +cent + +étoile + +coeur_jaune + +arc-en-ciel + +Choisis le plus grand nombre : + +J\' <3 les arcs-en-ciel + +Tu as touché le centre, 500 points ! diff --git a/fr-FR/quiz1/question_1.md b/fr-FR/quiz1/question_1.md new file mode 100644 index 0000000..793b887 --- /dev/null +++ b/fr-FR/quiz1/question_1.md @@ -0,0 +1,89 @@ +## Questionnaire rapide + +## --- question --- + +## legend: Question 1 sur 3 + +Ce code définit la variable `monde` pour qu'elle contienne le texte '🌍🌎🌏' (les trois différents emojis monde) : + +## --- code --- + +## language: python + +monde = '🌍🌎🌏' + +\--- /code --- + +Quel code utilise correctement la variable `monde` et affiche Bonjour 🌍🌎🌏 ? + +![La zone de sortie du Code Editor avec Bonjour 🌍🌎🌏 affiché.](images/quiz1.png) + +\--- choices --- + +- ( ) + +## --- code --- + +## language: python + +output('Bonjour' monde) + +\--- /code --- + +\--- feedback --- + +Pas tout à fait, `output` n'est pas le moyen d'afficher des messages à l'écran. + +\--- /feedback --- + +- ( ) + +## --- code --- + +## language: python + +print('Bonjour' monde) + +\--- /code --- + +\--- feedback --- + +Pas tout à fait, en Python `print` affiche des messages à l'écran, mais il manque quelque chose dans cet exemple. + +\--- /feedback --- + +- (x) + +## --- code --- + +## language: python + +print(f'Bonjour {monde}') + +\--- /code --- + +\--- feedback --- + +C'est correct, en Python, `print(f'')` affiche des messages à l'écran. La sortie du texte est entre guillemets simples `'`, et les accolades `{}` sont utilisées pour imprimer la variable `monde`. + +\--- /feedback --- + +- ( ) + +## --- code --- + +## language: python + +print('Bonjour {monde}') + +\--- /code --- + +\--- feedback --- + +Pas tout à fait, en Python `print` affiche des messages à l'écran, mais il manque quelque chose dans cet exemple. + +\--- /feedback --- + +\--- /choices --- + +\--- /question --- diff --git a/fr-FR/quiz1/question_2.md b/fr-FR/quiz1/question_2.md new file mode 100644 index 0000000..b1f18ff --- /dev/null +++ b/fr-FR/quiz1/question_2.md @@ -0,0 +1,64 @@ +## --- question --- + +## legend: Question 2 sur 3 + +Laquelle de ces définitions de fonction est correcte et affichera `Je peux coder` lorsqu'elle sera appelée ? + +![Le Code Editor avec une zone de sortie indiquant Je peux coder.](images/quiz2.png) + +\--- choices --- + +- (x) + +## --- code --- + +## language: python + +def impressionnant(): +print('Je peux coder') + +\--- /code --- + +\--- feedback --- + +C'est exact, appeler cette fonction affichera `Je peux coder`. Tu as remarqué que les fonctions nécessitent des parenthèses `(``)` et un `:` dans leur définition, et que tout le code à exécuter lorsque cette fonction est appelée doit être indenté. + +\--- /feedback --- + +- () + +## --- code --- + +## language: python + +def impressionnant(): +print('Je peux coder') + +\--- /code --- + +\--- feedback --- + +Pas tout à fait, la mise en forme dans cet exemple provoquerait une erreur. + +\--- /feedback --- + +- ( ) + +## --- code --- + +## language: python + +def impressionnant(): +print('Je peux coder') + +\--- /code --- + +\--- feedback --- + +Pas tout à fait, il manque quelque chose dans la définition de la fonction qui provoquerait une erreur. + +\--- /feedback --- + +\--- /choices --- + +\--- /question --- diff --git a/fr-FR/quiz1/question_3.md b/fr-FR/quiz1/question_3.md new file mode 100644 index 0000000..2ab92ec --- /dev/null +++ b/fr-FR/quiz1/question_3.md @@ -0,0 +1,92 @@ +## --- question --- + +## legend: Question 3 sur 3 + +Cette fonction génère deux nombres aléatoires : + +## --- code --- + +## language: python + +def deux_des(): +print('Premier nombre :', randint(1, 6)) +print('Deuxième nombre :', randint(1, 6)) + +\--- /code --- + +Quel code appellera la fonction pour l'exécuter ? + +![Le Code Editor avec une zone de sortie affichant deux nombres générés aléatoirement.](images/quiz3.png) + +\--- choices --- + +- ( ) + +## --- code --- + +## language: python + +def deux_des(): +print('Premier nombre :', randint(1, 6)) +print('Deuxième nombre :', randint(1, 6)) + +\--- /code --- + +\--- feedback --- + +Non, c'est le code pour définir la fonction, mais il n'exécute pas la fonction. Tu dois utiliser un code différent pour l'appeler. + +\--- /feedback --- + +- ( ) + \--- code --- + +--- + +## language: python + +deux_des + +\--- /code --- + +\--- feedback --- + +Presque ! `deux_des` est le nom de la fonction, mais pour l'appeler, il faut plus que le nom. + +\--- /feedback --- + +- () + +## --- code --- + +## language: python + +deux_des[] + +\--- /code --- + +\--- feedback --- + +Pas tout à fait, pense au type de parenthèses que tu as utilisé pour appeler les fonctions de ton projet. + +\--- /feedback --- + +- (x) + +## --- code --- + +## language: python + +deux_des() + +\--- /code --- + +\--- feedback --- + +C'est correct, l'utilisation du nom de la fonction suivi des parenthèses `(` `)` appellera la fonction. + +\--- /feedback --- + +\--- /choices --- + +\--- /question --- diff --git a/fr-FR/step_1.md b/fr-FR/step_1.md new file mode 100644 index 0000000..44fd427 --- /dev/null +++ b/fr-FR/step_1.md @@ -0,0 +1,55 @@ +

Print Bonjour

+ +\--- task --- + +➡️ Afficher le mot 'Bonjour' sur l'écran + +\--- /task --- + +En Python, `print()`{:.language-python} affiche des chaînes (mots ou nombres) à l'écran. + +Tape le code pour `print()`{:.language-python}(imprimer) Bonjour à l'écran : + +
+ +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 11 +-------------------------------------------------------- + +# Mettre le code à exécuter ci-dessous. + +print(f'Bonjour ') + +\--- /code --- + +
+ +**Test :** clique sur le bouton **Run**. +Tu devrais voir ceci lorsque tu exécutes ton code . + +
+``` +Bonjour +``` +
+ +
+ +### Astuce + +Lorsque tu tapes une parenthèse ouvrante `(`{:.language-python} , le Code Editor ajoutera automatiquement une parenthèse fermante `)`{:.language-python} +Cela se produit également lorsque tu tapes une apostrophe ouvrante `'`{:.language-python}. + +
+ +
+ +### Déboguer + +Si tu obtiens une erreur, vérifie ton code très attentivement. Vérifie qu'il y a des guillemets simples autour de `Bonjour`{:.language-python} afin que Python sache qu'il s'agit de texte. + +
diff --git a/fr-FR/step_10.md b/fr-FR/step_10.md new file mode 100644 index 0000000..ca50e30 --- /dev/null +++ b/fr-FR/step_10.md @@ -0,0 +1,73 @@ +

Lancer un dé

+ +\--- task --- + +➡️ Créer une fonction pour simuler le lancement d'un dé. + +➡️ Appeler la fonction pour exécuter le code qu'elle contient. + +\--- /task --- + +Crée une fonction appelée `roule_de()`, qui imprime le nombre 4. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 9 +line_highlights: 10, 11 +------------------------------------------------------------ + +# Définitions de fonctions + +def roule_de(): +print(f'Tu as obtenu un {4}') + +# Mettre le code à exécuter ci-dessous + +\--- /code --- + +Ensuite, appelle la fonction en bas de ton code. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 18 +line_highlights: 19 +-------------------------------------------------------- + +print(f'La date et l'heure sont {datetime.now()}') +roule_de() + +\--- /code --- + +**Test :** clique sur le bouton **Run**. +Tu devrais voir ceci lorsque tu exécutes ton code. + +
+``` +Bonjour 🌍🌎🌏 +Bienvenue sur Python 🐍 +Python 🐍 est bon en maths ! +12345678987654321 +La date et l'heure sont 2023-11-21 15:55:33.038000 +Tu as obtenu un 4 +``` +
+ +
+ +### Astuce + +Tu peux utiliser la touche **Tab** de ton clavier pour insérer 4 espaces. Appuyer sur **Maj** et **Tab** supprimera les 4 espaces. + +
+ +
+ +### Déboguer + +Vérifie que tu as des parenthèses `()` et deux points `:` à la fin de ta définition de fonction. Vérifie également que tu utilises des parenthèses `()` lorsque tu appelles ta fonction. + +
diff --git a/fr-FR/step_11.md b/fr-FR/step_11.md new file mode 100644 index 0000000..39a93aa --- /dev/null +++ b/fr-FR/step_11.md @@ -0,0 +1,27 @@ +

Importer randint

+ +\--- task --- + +➡️ Importer la fonction `randint` depuis le module `random`. + +\--- /task --- + +Un autre module appelé `random` peut être utilisé pour créer des nombres aléatoires + +## --- code --- + +language: python +line_numbers: true +line_number_start: 1 +line_highlights: 3 +------------------------------------------------------- + +# importations + +from datetime import datetime +from random import randint + +\--- /code --- + +Le résultat de ton code restera identique à chaque exécution. + diff --git a/fr-FR/step_12.md b/fr-FR/step_12.md new file mode 100644 index 0000000..80f2242 --- /dev/null +++ b/fr-FR/step_12.md @@ -0,0 +1,54 @@ +

Nombres aléatoires

+ +\--- task --- + +➡️ Choisir un nombre aléatoire pour le lancer de dés. + +\--- /task --- + +Utilise la fonction `randint` que tu as importée pour choisir un nombre aléatoire entre 1 et 6 pour le lancer de dés. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 12 +-------------------------------------------------------- + +# Définitions de fonctions + +def roule_de(): +print(f'Tu as obtenu un {randint(1, 6)}') + +\--- /code --- + +**Test :** clique sur le bouton **Run**. +Maintenant, lorsque tu exécutes ton code, un nouveau nombre aléatoire entre 1 et 6 sera choisi à chaque fois. + +
+``` +Bonjour 🌍🌎🌏 +Bienvenue sur Python 🐍 +Python 🐍 est bon en maths ! +12345678987654321 +La date et l'heure sont 2023-11-21 16:02:12.535000 +Tu as obtenu un 6 +``` +
+ +
+ +### Astuce + +`randint` est l'abréviation d'entier aléatoire. Les entiers sont des nombres entiers. + +
+ +
+ +### Déboguer + +Vérifie tes parenthèses et accolades si tu obtiens une erreur. Note que le même nombre peut être choisi plusieurs fois. C'est aléatoire ! + +
diff --git a/fr-FR/step_13.md b/fr-FR/step_13.md new file mode 100644 index 0000000..1f66c86 --- /dev/null +++ b/fr-FR/step_13.md @@ -0,0 +1,67 @@ +

Multiplier les chaînes

+ +\--- task --- + +➡️ Stocker le nombre aléatoire dans une variable. +➡️ Multiplier le nombre par l'emoji 🔥 pour imprimer l'emoji un nombre de fois égal au lancer de dés. + +\--- /task --- + +En Python, tu peux multiplier des chaînes de caractères telles que des emojis ou des mots entiers par un nombre, afin qu'elles s'impriment plusieurs fois. + +Stocke le nombre aléatoire dans une variable appelée `roule`. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 12 +-------------------------------------------------------- + +# Définitions de fonctions + +def roule_de(): +roule = randint(1,6) + +\--- /code --- + +Multiplie le nombre aléatoire stocké dans `roule` par l'emoji 🔥 et imprime le résultat. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 13 +-------------------------------------------------------- + +# Définitions de fonctions + +def roule_de(): +roule = randint(1,6) +print(f'Tu as obtenu un {roule} {feu \* roule}') + +\--- /code --- + +**Test :** clique sur le bouton **Run**. +Ton code de sortie devrait ressembler à ceci : + +
+``` +Bonjour 🌍🌎🌏 +Bienvenue sur Python 🐍 +Python 🐍 est bon en maths ! +12345678987654321 +La date et l'heure sont 2023-11-21 16:14:45.140000 +Tu as obtenu un 4 🔥🔥🔥🔥 +``` +
+ +
+ +### Déboguer + +Vérifie que toutes tes parenthèses sont identiques à celles de l’exemple de code ci-dessus. + +
diff --git a/fr-FR/step_14.md b/fr-FR/step_14.md new file mode 100644 index 0000000..e7877f9 --- /dev/null +++ b/fr-FR/step_14.md @@ -0,0 +1,45 @@ +

Obtenir une entrée

+ +\--- task --- + +➡️ Permettre à la personne qui utilise ton programme de saisir des données. + +\--- /task --- + +Tu peux utiliser `input()` pour demander à la personne utilisant ton programme de saisir du texte et de l'enregistrer en tant que variable. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 12-13 +----------------------------------------------------------- + +# Définitions de fonctions + +def roule_de(): +max = input('Combien de faces y a-t-il sur ton dé ?') +print(f'C\'est un D {max}') +roule = randint(1,6) +print(f'Tu as obtenu un {roule} {feu \* roule}') + +\--- /code --- + +**Test :** clique sur le bouton **Run**. +Assure-toi d'appuyer sur la touche Entrée après avoir saisi le nombre de faces. +Tu devrais voir ceci lorsque tu exécutes ton code. + +
+``` +Bonjour 🌍🌎🌏 +Bienvenue sur Python 🐍 +Python 🐍 est bon en maths ! +12345678987654321 +La date et l'heure sont 2023-11-21 16:20:41.323000 +Combien de faces y a-t-il sur ton dé ? +20 +C'est un D 20 +Tu as obtenu un 1 🔥 +``` +
diff --git a/fr-FR/step_15.md b/fr-FR/step_15.md new file mode 100644 index 0000000..0aa5746 --- /dev/null +++ b/fr-FR/step_15.md @@ -0,0 +1,54 @@ +

Changer le dé

+ +\--- task --- + +➡️ Modifier les données d’entrée en un entier. +➡️ Génèrer un nombre aléatoire compris entre 1 et le nombre de faces saisi par l'utilisateur. + +\--- /task --- + +Les entrées sont toujours stockées sous forme de texte, mais nous devons utiliser l'entrée stockée dans `max` pour spécifier le plus grand nombre qui pourrait être obtenu. + +`max` est une chaîne, elle doit donc être changée en un entier `int()`. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 14 +-------------------------------------------------------- + +# Définitions de fonctions + +def roule_de(): +max = input('Combien de faces y a-t-il sur ton dé ?') +print(f'C\'est un D {max}') +roule = randint(1, int(max)) +print(f'Tu as obtenu un {roule} {feu \* roule}') + +\--- /code --- + +**Test :** clique sur le bouton **Run**. +Voici ce que tu devrais voir : + +
+``` +Bonjour 🌍🌎🌏 +Bienvenue sur Python 🐍 +Python 🐍 est bon en maths ! +12345678987654321 +La date et l'heure sont 2023-11-21 16:27:24.101000 +Combien de faces y a-t-il sur ton dé ?:12 +C'est un D 12 +Tu as obtenu un 5 🔥🔥🔥🔥🔥 +``` +
+ +
+ +### Astuce + +La modification d’un type de données en un autre type de données est appelée **type casting**. + +
\ No newline at end of file diff --git a/fr-FR/step_16.md b/fr-FR/step_16.md new file mode 100644 index 0000000..d09cf52 --- /dev/null +++ b/fr-FR/step_16.md @@ -0,0 +1,38 @@ +

À toi de jouer

+ +\--- task --- + +➡️ S'entraîner à ajouter plus de lignes `print` à ton code. + +\--- /task --- + +Voici quelques débuts de phrases que tu peux utiliser : + +## --- code --- + +language: python +line_numbers: true +line_number_start: 23 +line_highlights: 24-26 +----------------------------------------------------------- + +roule_de() +print(f'J\'❤️ ...') +print(f'... me fait 😃') +print(f'Je voudrais faire ... avec {python}') + +\--- /code --- + +
+ +### Astuce + +Voici une liste d'emojis que tu pourrais utiliser : + +🎊 🙌 🙌🏼 🙌🏽 🙌🏾 🙌🏿 😃 🕒 🎨 🎮 🔬 🎉 🕶️ 🎲 😊 +🦄 🚀 💯 ⭐ 💛 ❤️ 📚 ⚽ 🏏 🏀 🥋 🏆 ✨ 🥺 🌈 🔥 ♻️ 🌳 +👩‍🦽👩🏼‍🦽👩🏽‍🦽👩🏾‍🦽👩🏿‍🦽🧘 🧘🏼 🧘🏽 🧘🏾 🧘🏿 🙋 🙋🏼 🙋🏽 🙋🏾 🙋🏿 + +Tu peux les copier et les coller dans ton code. + +
diff --git a/fr-FR/step_17.md b/fr-FR/step_17.md new file mode 100644 index 0000000..30c2f67 --- /dev/null +++ b/fr-FR/step_17.md @@ -0,0 +1 @@ +## Réflexion \ No newline at end of file diff --git a/fr-FR/step_18.md b/fr-FR/step_18.md new file mode 100644 index 0000000..e2e275e --- /dev/null +++ b/fr-FR/step_18.md @@ -0,0 +1,13 @@ +

Tu as terminé le projet 🎉

+ +\--- task --- + +Nous aimerions connaître ton avis sur l’utilisation du Code Editor pour terminer le projet Bonjour Monde ! + +➡️ Peux-tu remplir notre [formulaire de commentaires](https://form.raspberrypi.org/4873648){:target="_blank"} pour nous le faire savoir ? + +### Et ensuite ? + +Si tu suis le parcours [Introduction à Python](https://projects.raspberrypi.org/en/raspberrypi/python-intro), tu peux passer au projet [Tir sur cible](https://projects.raspberrypi.org/en/projects/target-practice). Dans ce projet, tu dessineras une cible puis créeras un jeu de tir à l'arc où le joueur tire des flèches pour marquer des points. + +\--- /task --- diff --git a/fr-FR/step_2.md b/fr-FR/step_2.md new file mode 100644 index 0000000..14c257f --- /dev/null +++ b/fr-FR/step_2.md @@ -0,0 +1,39 @@ +

Variables

+ +
+ +### Astuce + +Une **variable** est utilisée pour stocker des valeurs telles que du texte ou des nombres. Choisir un nom judicieux pour une variable te permet de te rappeler plus facilement à quoi elle sert. + +
+ +Nous avons inclus quelques variables qui stockent les caractères emoji. + +
+ +## --- code --- + +language: python +line_numbers: true +line_number_start: 3 +line_highlights: 4-6 +--------------------------------------------------------- + +# variables + +monde = '🌍🌎🌏' +python = 'Python 🐍' +feu = '🔥' + +# Définitions de fonctions + +# Mettre le code à exécuter ci-dessous + +print(f'Bonjour') + +\--- /code --- + +
+ + diff --git a/fr-FR/step_3.md b/fr-FR/step_3.md new file mode 100644 index 0000000..6fb5788 --- /dev/null +++ b/fr-FR/step_3.md @@ -0,0 +1,56 @@ +

Imprimer des variables

+ +\--- task --- + +➡️ Imprimer le contenu d'une variable. + +\--- /task --- + +Change ton code pour aussi `print()` le contenu de la variable `monde`. Tu peux le faire en ajoutant le nom de la variable entre accolades `{}` + +## --- code --- + +language: python +line_numbers: true +line_number_start: 3 +line_highlights: 11 +-------------------------------------------------------- + +# variables + +monde = '🌍🌎🌏' +python = 'Python 🐍' +feu = '🔥' + +# Définitions de fonctions + +# Mettre le code à exécuter ci-dessous + +print(f'Bonjour {monde}') + +\--- /code --- + +**Test :** clique sur le bouton **Run**. +Tu devrais voir ceci lorsque tu exécutes ton code. + +
+``` +Bonjour 🌍🌎🌏 +``` +
+ +
+ +### Astuce + +Le caractère `f` à l'intérieur de print te permet d'imprimer facilement des variables avec des chaînes de texte. + +
+ +
+ +### Déboguer + +Si tu obtiens une erreur, vérifie que tu as ouvert et fermé toutes tes parenthèses `()` et tes accolades `{}` + +
diff --git a/fr-FR/step_4.md b/fr-FR/step_4.md new file mode 100644 index 0000000..7ba126e --- /dev/null +++ b/fr-FR/step_4.md @@ -0,0 +1,34 @@ +

Imprimer une autre variable

+ +\--- task --- + +➡️ Imprimer le contenu de la variable `python`. + +\--- /task --- + +**Ajoute** une autre ligne à ton code pour `print()` plus de texte et d'emojis : + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 12 +-------------------------------------------------------- + +# Mettre le code à exécuter ci-dessous + +print(f'Bonjour {monde}') +print(f'Bienvenue sur {python}') + +\--- /code --- + +**Test :** clique sur le bouton **Run**. +Tu devrais voir ceci lorsque tu exécutes ton code. + +
+``` +Bonjour 🌍🌎🌏 +Bienvenue sur Python 🐍 +``` +
diff --git a/fr-FR/step_5.md b/fr-FR/step_5.md new file mode 100644 index 0000000..10704d0 --- /dev/null +++ b/fr-FR/step_5.md @@ -0,0 +1,11 @@ +

Opérateurs

+ +En Python, tu peux travailler avec des nombres et des dates. Tu peux utiliser des **opérateurs arithmétiques** tels que `+` et `-` pour effectuer des calculs : + +\| + | addition | +\| - | soustraction | +\| \* | multiplication | +\| / | division | +\| \*\* | puissance | + + diff --git a/fr-FR/step_6.md b/fr-FR/step_6.md new file mode 100644 index 0000000..71a9651 --- /dev/null +++ b/fr-FR/step_6.md @@ -0,0 +1,54 @@ +

Créer un calcul

+ +\--- task --- + +➡️ Imprimer la valeur d'un calcul. + +\--- /task --- + +Ajoute deux autres lignes `print()` à ton code, y compris une multiplication pour que Python puisse calculer : + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 13-14 +----------------------------------------------------------- + +# Mettre le code à exécuter ci-dessous + +print(f'Bonjour {monde}') +print(f'Bienvenue sur {python}') +print(f'{python} est bon en maths !') +print(f'{111111111 \* 111111111}') + +\--- /code --- + +**Test :** clique sur le bouton **Run**. +Tu devrais voir ceci lorsque tu exécutes ton code. + +
+``` +Bonjour 🌍🌎🌏 +Bienvenue sur Python 🐍 +Python 🐍 est bon en maths ! +12345678987654321 +``` +
+ +
+ +### Astuce + +Python utilise les mêmes règles de calcul que celles que tu as peut-être apprises à l’école. **P**arenthèses d'abord, puis les **O**rdres, **D**ivision, **M**ultiplication, **A**ddition, et enfin **S**oustraction. + +
+ +
+ +### Déboguer + +N'oublie pas que les lettres MAJUSCULES et minuscules sont importantes en Python. Vérifie toujours que tu utilises la bonne case. + +
diff --git a/fr-FR/step_7.md b/fr-FR/step_7.md new file mode 100644 index 0000000..0e3bfb5 --- /dev/null +++ b/fr-FR/step_7.md @@ -0,0 +1,45 @@ +

Utilisation des modules

+ +\--- task --- + +➡️ Importer le module `datetime`. + +\--- /task --- + +Python possède de nombreux **modules** que tu peux utiliser dans ton code pour t'aider à effectuer certaines tâches. Pour utiliser un module, tu dois d’abord l’**importer**. + +Le module `datetime` aide à écrire du code qui utilise des dates et des heures. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 1 +line_highlights: 2 +------------------------------------------------------- + +# importations + +from datetime import datetime + +# variables + +\--- /code --- + +Quand tu exécutes ce code, rien ne devrait changer et tu devrais avoir le même résultat que l’étape précédente. + +
+ +### Astuce + +Tout texte que tu écris en Python avec un `#` devant devient un commentaire. Ces lignes ne seront pas exécutées, elles peuvent donc être utiles pour aider les gens à lire et à comprendre ton code. + +
+ +
+ +### Déboguer + +Vérifie que tu as correctement orthographié `datetime` et que tout est en minuscules. + +
diff --git a/fr-FR/step_8.md b/fr-FR/step_8.md new file mode 100644 index 0000000..0500705 --- /dev/null +++ b/fr-FR/step_8.md @@ -0,0 +1,46 @@ +

Imprimer la date

+ +\--- task --- + +➡️ Afficher la date et l'heure actuelles. + +\--- /task --- + +Ajoute une autre ligne à ton code pour `print` la date et l'heure actuelles. + +Obtiens la date et l'heure actuelles en utilisant la fonction `now()` du module `datetime` : + +## --- code --- + +language: python +line_numbers: true +line_number_start: 14 +line_highlights: 16 +-------------------------------------------------------- + +print(f'{python} est bon en maths !') +print(f'{111111111 \* 111111111}') +print(f'La date et l'heure sont {datetime.now()}') + +\--- /code --- + +**Test :** clique sur le bouton **Run**. +C'est ce que tu devrais voir lorsque tu exécutes ton code, mais la date et l'heure seront différentes. + +
+``` +Bonjour 🌍🌎🌏 +Bienvenue sur Python 🐍 +Python 🐍 est bon en maths ! +12345678987654321 +La date et l'heure sont 2023-11-21 15:34:10.148000 +``` +
+ +
+ +### Déboguer + +Vérifie toutes tes parenthèses `()` et tes accolades `{}` pour t'assurer qu'ils sont tous ouverts et fermés au bon endroit. + +
diff --git a/fr-FR/step_9.md b/fr-FR/step_9.md new file mode 100644 index 0000000..4e849fe --- /dev/null +++ b/fr-FR/step_9.md @@ -0,0 +1,26 @@ +

Fonctions

+ +Les fonctions sont des blocs de code qui exécutent des tâches spécifiques. Elles peuvent être utilisées à l'infini. + +Voici un exemple de fonction : + +## --- code --- + +language: python +line_numbers: false +-------------------------------------------------------- + +# Définitions de fonctions + +def ajoute_un_et_un(): +x = 1 + 1 +print(x) + +\--- /code --- + +Le nom de cette fonction est `ajoute_un_et_un`. + +Le code de la tâche que tu souhaites que la fonction effectue doit être **indenté**, ce qui signifie que tu dois ajouter **quatre espaces** avant chaque ligne de code. + +**L'appel** d'une fonction exécute le code qu'elle contient. Tu **appelles** une fonction en utilisant son nom. Ici, `ajoute_un_et_un()`. + diff --git a/nl-NL/code/complete/main.py b/nl-NL/code/complete/main.py new file mode 100644 index 0000000..72a454d --- /dev/null +++ b/nl-NL/code/complete/main.py @@ -0,0 +1,25 @@ +# imports +from datetime import datetime +from random import randint + +wereld = '🌍🌎🌏' +python = 'Python 🐍' +vuur = '🔥' + +# Functiedefinities +def gooi_dobbelsteen(): + max = input('Hoeveel zijden heeft je dobbelsteen?:') + print(f'Dat is een D {max}') + worp = randint(1, int(max)) + print(f'Je hebt een {roll} {vuur * rol}') gegooid + +# Zet de code om uit te voeren hieronder +print(f'Hallo{world}') +print(f"Welkom bij {python}') +print(f'{python} is goed in wiskunde!') +print(f'{111111111 * 111111111}') +print(f'De datum en tijd zijn {datetime.now()}') +gooi_dobbelsteen() #Roep de dobbelsteen functie aan +print(f'Ik ❤️ ...') +print(f'... maakt mij 😃') +print(f'Ik zou graag willen maken ... maken met {python}') diff --git a/nl-NL/code/complete/project_config.yml b/nl-NL/code/complete/project_config.yml new file mode 100644 index 0000000..8467d43 --- /dev/null +++ b/nl-NL/code/complete/project_config.yml @@ -0,0 +1,3 @@ +name: "Hallo 🌍🌎🌏" +identifier: "editor-hello-world-complete" +type: 'python' diff --git a/nl-NL/code/starter/main.py b/nl-NL/code/starter/main.py new file mode 100644 index 0000000..159f9d3 --- /dev/null +++ b/nl-NL/code/starter/main.py @@ -0,0 +1,11 @@ +# imports + +# variables +world = '🌍🌎🌏' +python = 'Python 🐍' +fire = '🔥' + +# Function definitions + +# Put code to run under here + diff --git a/nl-NL/code/starter/project_config.yml b/nl-NL/code/starter/project_config.yml new file mode 100644 index 0000000..fc1d670 --- /dev/null +++ b/nl-NL/code/starter/project_config.yml @@ -0,0 +1,3 @@ +name: "Hallo 🌍🌎🌏" +identifier: "editor-hello-world-starter" +type: 'python' diff --git a/nl-NL/images/banner.png b/nl-NL/images/banner.png new file mode 100644 index 0000000..a6bd889 Binary files /dev/null and b/nl-NL/images/banner.png differ diff --git a/nl-NL/images/blue-points.png b/nl-NL/images/blue-points.png new file mode 100644 index 0000000..5768422 Binary files /dev/null and b/nl-NL/images/blue-points.png differ diff --git a/nl-NL/images/comma_error.png b/nl-NL/images/comma_error.png new file mode 100644 index 0000000..224bfe7 Binary files /dev/null and b/nl-NL/images/comma_error.png differ diff --git a/nl-NL/images/full_screen.png b/nl-NL/images/full_screen.png new file mode 100644 index 0000000..b45cc1f Binary files /dev/null and b/nl-NL/images/full_screen.png differ diff --git a/nl-NL/images/hello_error.png b/nl-NL/images/hello_error.png new file mode 100644 index 0000000..32d2a38 Binary files /dev/null and b/nl-NL/images/hello_error.png differ diff --git a/nl-NL/images/indent_error.png b/nl-NL/images/indent_error.png new file mode 100644 index 0000000..9874040 Binary files /dev/null and b/nl-NL/images/indent_error.png differ diff --git a/nl-NL/images/quiz1.png b/nl-NL/images/quiz1.png new file mode 100644 index 0000000..21c8f10 Binary files /dev/null and b/nl-NL/images/quiz1.png differ diff --git a/nl-NL/images/quiz2.png b/nl-NL/images/quiz2.png new file mode 100644 index 0000000..2bdc53f Binary files /dev/null and b/nl-NL/images/quiz2.png differ diff --git a/nl-NL/images/quiz3.png b/nl-NL/images/quiz3.png new file mode 100644 index 0000000..a634a9b Binary files /dev/null and b/nl-NL/images/quiz3.png differ diff --git a/nl-NL/images/roll_dice.png b/nl-NL/images/roll_dice.png new file mode 100644 index 0000000..4c274da Binary files /dev/null and b/nl-NL/images/roll_dice.png differ diff --git a/nl-NL/images/run_hello.png b/nl-NL/images/run_hello.png new file mode 100644 index 0000000..c89c369 Binary files /dev/null and b/nl-NL/images/run_hello.png differ diff --git a/nl-NL/images/run_hello_world.png b/nl-NL/images/run_hello_world.png new file mode 100644 index 0000000..653543c Binary files /dev/null and b/nl-NL/images/run_hello_world.png differ diff --git a/nl-NL/images/run_multiple.png b/nl-NL/images/run_multiple.png new file mode 100644 index 0000000..e1b8aa7 Binary files /dev/null and b/nl-NL/images/run_multiple.png differ diff --git a/nl-NL/images/say_hello.png b/nl-NL/images/say_hello.png new file mode 100644 index 0000000..e1b8aa7 Binary files /dev/null and b/nl-NL/images/say_hello.png differ diff --git a/nl-NL/images/sentence_starter.png b/nl-NL/images/sentence_starter.png new file mode 100644 index 0000000..c3d9b67 Binary files /dev/null and b/nl-NL/images/sentence_starter.png differ diff --git a/nl-NL/images/showcase_static.png b/nl-NL/images/showcase_static.png new file mode 100644 index 0000000..196c0cb Binary files /dev/null and b/nl-NL/images/showcase_static.png differ diff --git a/nl-NL/images/starter_project.png b/nl-NL/images/starter_project.png new file mode 100644 index 0000000..cc90493 Binary files /dev/null and b/nl-NL/images/starter_project.png differ diff --git a/nl-NL/images/sums_dates.png b/nl-NL/images/sums_dates.png new file mode 100644 index 0000000..574bc1f Binary files /dev/null and b/nl-NL/images/sums_dates.png differ diff --git a/nl-NL/images/upgrade_ideas.png b/nl-NL/images/upgrade_ideas.png new file mode 100644 index 0000000..53bcd64 Binary files /dev/null and b/nl-NL/images/upgrade_ideas.png differ diff --git a/nl-NL/meta.yml b/nl-NL/meta.yml new file mode 100644 index 0000000..64e800e --- /dev/null +++ b/nl-NL/meta.yml @@ -0,0 +1,57 @@ +title: "Editor Hello \U0001F30D\U0001F30E\U0001F30F" +hero_image: images/banner.png +description: Schrijf een interactief Python-project dat emoji gebruikt +meta_title: Python programmeer projecten voor kinderen en tieners | Hallo wereld +meta_description: Leer Python met de Raspberry Pi Foundation. Maak een interactief Python-codeer project dat emoji's gebruikt. +version: 4 +listed: false +copyedit: false +last_tested: "2021-10-06" +steps: + - + title: step 1 + - + title: step 2 + completion: + - engaged + - + title: step 3 + - + title: step 4 + - + title: step 5 + - + title: step 6 + - + title: step 7 + - + title: step 8 + - + title: step 9 + - + title: step 10 + - + title: step 11 + - + title: step 12 + - + title: step 13 + - + title: step 14 + - + title: step 15 + - + title: step 16 + completion: + - internal + - + title: step 17 + knowledge_quiz: + path: quiz1 + version: 1 + questions: 3 + passing_score: 3 + - + title: step 18 + completion: + - external diff --git a/nl-NL/python-comments.txt b/nl-NL/python-comments.txt new file mode 100644 index 0000000..0cf1694 --- /dev/null +++ b/nl-NL/python-comments.txt @@ -0,0 +1,43 @@ +Zet de code om uit te voeren hier onder + +Print het resultaat van de som + +Afdrukken met emoji + +Zet de functie definities hier onder + +Vergeet de dubbele punt aan het einde van deze regel niet + +Roep de functie gooi_dobbelsteen aan + +Genereer een willekeurig getal tussen 1 en 6 + +Druk de waarde van de worp variabele af + +Herhaal de vuuremoji om bij de dobbelsteenworp te passen + +Wacht op invoer van de gebruiker + +Gebruik het getal dat de gebruiker heeft ingevoerd + +randint vereist dat max een 'geheel getal' is + +Wacht tot de gebruiker op Enter drukt + +Nuttige tekens :',()*_/.# + +Emoji-variabelen die je in je project kunt gebruiken + +ASCII-kunstalternatieven toevoegen + +Voor emoji gebruikten we emoticons gemaakt van karakters + +vraag invoer van de gebruiker + +genereer een willekeurige getal + +herhaal worp keer de vuurtekst + +de huidige datum en tijd ophalen + +Roep de functie hobbies aan diff --git a/nl-NL/python-translatable.txt b/nl-NL/python-translatable.txt new file mode 100644 index 0000000..3c2975f --- /dev/null +++ b/nl-NL/python-translatable.txt @@ -0,0 +1,101 @@ +Hallo + +Welkom bij ... + +...is erg goed in ... + +De ...is + +...kan een ...maken + +Je gooide een... + +Hoeveel kanten? + +Dat is een D... + +Ik <3 ... + +...maakt mij ... + +Ik wil graag ...maken met... + +geweldig + +Ik kan coderen + +twee_dobbelstenen + +Eerste getal: + +Tweede getal: + +hobbies + +hobby + +Wat vind je leuk? + +Dat klinkt ... + +Je zou een ...project kunnen maken over ... + +gooi_dobbelsteen + +worp + +nu + +wereld + +sommen + +kalender + +klok + +projecten + +plezier + +dobbelsteen + +eenhoorn + +space + +gelukkig + +maf + +hart + +games + +boeken + +sporten + +green + +natuur + +vuur + +schitteringen + +pleiten + +honderd + +ster + +geel_hart + +regenboog + +Kies het grootste aantal: + +Ik <3 regenbogen + +In de roos, 500 punten! diff --git a/nl-NL/quiz1/question_1.md b/nl-NL/quiz1/question_1.md new file mode 100644 index 0000000..5fca6a2 --- /dev/null +++ b/nl-NL/quiz1/question_1.md @@ -0,0 +1,89 @@ +## Snelle quiz + +## --- question --- + +## legend: Vraag 1 van 3 + +Deze code stelt de wereld-variabele in om de tekst '🌍🌎🌏' te bevatten (de drie verschillende wereldbolemoji): + +## --- code --- + +## language: python + +wereld = '🌍🌎🌏' + +\--- /code --- + +Welke code gebruikt de 'world' variabele correct en geeft Hallo 🌍🌎🌏 als resultaat? + +![Het uitvoergebied van de code-editor waarin Hallo 🌍🌎🌏 wordt weergegeven.](images/quiz1.png) + +\--- choices --- + +- ( ) + +## --- code --- + +## language: python + +output('Hallo' wereld) + +\--- /code --- + +\--- feedback --- + +Niet helemaal, 'output' is niet de manier om berichten naar het scherm te sturen. + +\--- /feedback --- + +- ( ) + +## --- code --- + +## language: python + +print('Hallo' wereld) + +\--- /code --- + +\--- feedback --- + +Niet helemaal, in Python stuurt 'print' berichten naar het scherm, maar er ontbreekt iets in dit voorbeeld. + +\--- /feedback --- + +- (x) + +## --- code --- + +## language: python + +print(f'Hallo{world}') + +\--- /code --- + +\--- feedback --- + +Dat klopt, in Python stuurt 'print(f")' berichten naar het scherm. De tekstuitvoer staat tussen enkele aanhalingstekens `'` en accolades `{}` worden gebruikt om de variabele `world` af te drukken. + +\--- /feedback --- + +- ( ) + +## --- code --- + +## language: python + +print('Hallo{world}') + +\--- /code --- + +\--- feedback --- + +Niet helemaal, in Python stuurt 'print' berichten naar het scherm, maar er ontbreekt iets in dit voorbeeld. + +\--- /feedback --- + +\--- /choices --- + +\--- /question --- diff --git a/nl-NL/quiz1/question_2.md b/nl-NL/quiz1/question_2.md new file mode 100644 index 0000000..853a348 --- /dev/null +++ b/nl-NL/quiz1/question_2.md @@ -0,0 +1,64 @@ +## --- question --- + +## legend: Vraag 2 van 3 + +Welke van deze functie definities is correct en geeft `Ik kan coderen` weer wanneer deze wordt aangeroepen? + +![De code-editor met het uitvoergebied met de tekst Ik kan coderen.](images/quiz2.png) + +\--- choices --- + +- (x) + +## --- code --- + +## language: python + +def geweldig(): +print('Ik kan coderen') + +\--- /code --- + +\--- feedback --- + +Dat klopt, als je deze functie aanroept, wordt 'Ik kan coderen' afgedrukt. Je hebt gezien dat functies '(' ')' haakjes en een ':' in de functiedefinitie nodig hebben, en dat alle uit te voeren code wanneer die functie wordt aangeroepen, moet worden ingesprongen. + +\--- /feedback --- + +- () + +## --- code --- + +## language: python + +def geweldig(): +print('Ik kan coderen') + +\--- /code --- + +\--- feedback --- + +Niet helemaal, de lay-out in dit voorbeeld zou een fout veroorzaken. + +\--- /feedback --- + +- ( ) + +## --- code --- + +## language: python + +def geweldig() +print('Ik kan coderen') + +\--- /code --- + +\--- feedback --- + +Niet helemaal, er ontbreekt iets in de functiedefinitie en deze lay-out zou een fout veroorzaken. + +\--- /feedback --- + +\--- /choices --- + +\--- /question --- diff --git a/nl-NL/quiz1/question_3.md b/nl-NL/quiz1/question_3.md new file mode 100644 index 0000000..6a1bf06 --- /dev/null +++ b/nl-NL/quiz1/question_3.md @@ -0,0 +1,92 @@ +## --- question --- + +## legend: Vraag 3 van 3 + +Deze functie geeft twee willekeurige getallen: + +## --- code --- + +## language: python + +def twee_getallen(): +print('Eerste getal: ', randint(1, 6)) +print('Tweede getal: ', randint(1, 6)) + +\--- /code --- + +Welke code roept de functie aan om uit te voeren? + +![De code-editor met een uitvoergebied waarin twee willekeurig gegenereerde getallen worden weergegeven.](images/quiz3.png) + +\--- choices --- + +- ( ) + +## --- code --- + +## language: python + +def twee_getallen(): +print('Eerste getal: ', randint(1, 6)) +print('Tweede getal: ', randint(1, 6)) + +\--- /code --- + +\--- feedback --- + +Nee, dit is de code om de functie te definiëren, maar deze voert de functie niet uit. Je moet andere code gebruiken om de functie aan te roepen. + +\--- /feedback --- + +- ( ) + \--- code --- + +--- + +## language: python + +twee_dobbelstenen + +\--- /code --- + +\--- feedback --- + +Bijna! \`twee_getallen' is de naam van de functie, maar om deze aan te roepen heb je meer nodig dan alleen de naam. + +\--- /feedback --- + +- () + +## --- code --- + +## language: python + +twee_getallen[] + +\--- /code --- + +\--- feedback --- + +Niet helemaal, denk aan het type haakjes dat je moet gebruiken om de functies in je project aan te roepen. + +\--- /feedback --- + +- (x) + +## --- code --- + +## language: python + +twee_getallen() + +\--- /code --- + +\--- feedback --- + +Dat klopt, het gebruik van de functienaam gevolgd door '(' ')' haakjes zal de functie aanroepen. + +\--- /feedback --- + +\--- /choices --- + +\--- /question --- diff --git a/nl-NL/step_1.md b/nl-NL/step_1.md new file mode 100644 index 0000000..8116000 --- /dev/null +++ b/nl-NL/step_1.md @@ -0,0 +1,55 @@ +

Print Hallo

+ +\--- task --- + +➡️ Toon het woord 'Hallo' op het scherm + +\--- /task --- + +In Python geeft `print()`{:.language-python} output strings (woorden of getallen) weer op het scherm. + +Typ de code voor `print()`{:.language-python} Hallo op het scherm: + +
+ +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 11 +-------------------------------------------------------- + +# Zet de code om uit te voeren hieronder. + +print(f'Hallo') + +\--- /code --- + +
+ +**Test:** Klik op de **Run** knop. +Dit is wat je zou moeten zien wanneer je jouw code uitvoert. + +
+``` +Hallo +``` +
+ +
+ +### Tip + +Wanneer je een openingshaakje typt `(`{:.language-python} zal de code-editor automatisch een sluitingshaakje toevoegen `)`{:.language-python} +Dit gebeurt ook wanneer je een openingsapostrof typt `'`{:.language-python}. + +
+ +
+ +### Foutopsporing + +Als je een foutmelding krijgt, controleer dan jouw code zorgvuldig. Controleer of er enkele aanhalingstekens rond `Hallo`{:.language-python} staan, zodat Python weet dat het tekst moet zijn. + +
diff --git a/nl-NL/step_10.md b/nl-NL/step_10.md new file mode 100644 index 0000000..302d868 --- /dev/null +++ b/nl-NL/step_10.md @@ -0,0 +1,73 @@ +

Gooi dobbelstenen

+ +\--- task --- + +➡️ Maak een functie om het gooien van een dobbelsteen te simuleren. + +➡️ Roep de functie aan om de code erin uit te voeren. + +\--- /task --- + +Maak een functie genaamd `roll_dice()`, die het getal 4 afdrukt. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 9 +line_highlights: 10, 11 +------------------------------------------------------------ + +# Functiedefinities + +def roll_dice(): +print(f'Je hebt een {4} gegooid') + +# Zet de code om uit te voeren hier onder + +\--- /code --- + +Roep vervolgens de functie onderaan je code aan. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 18 +line_highlights: 19 +-------------------------------------------------------- + +print(f'De datum en tijd zijn {datetime.now()}') +roll_dice() + +\--- /code --- + +**Test:** Klik op de **Run** knop. +Dit is wat je zou moeten zien wanneer je jouw code uitvoert. + +
+``` +Hallo 🌍🌎🌏 +Welkom bij Python 🐍 +Python 🐍 is goed in wiskunde! +12345678987654321 +De datum en tijd zijn 2023-11-21 15:55:33.038000 +Je hebt een 4 gegooid +``` +
+ +
+ +### Tip + +Je kunt de **Tab**-toets op jouw toetsenbord gebruiken om 4 spaties in te voegen. Door op **Shift** en **Tab** te drukken, worden de 4 spaties verwijderd. + +
+ +
+ +### Foutopsporing + +Controleer of er haakjes `()` en een dubbele punt `:` aan het einde van jouw functiedefinitie staan. Controleer ook of je haakjes `()` gebruikt wanneer je jouw functie aanroept. + +
diff --git a/nl-NL/step_11.md b/nl-NL/step_11.md new file mode 100644 index 0000000..414b9d5 --- /dev/null +++ b/nl-NL/step_11.md @@ -0,0 +1,27 @@ +

Importeer randint

+ +\--- task --- + +➡️ Importeer de `randint`-functie vanuit de `random`-module. + +\--- /task --- + +Een andere module, genaamd 'random', kan worden gebruikt om willekeurige getallen te creëren + +## --- code --- + +language: python +line_numbers: true +line_number_start: 1 +line_highlights: 3 +------------------------------------------------------- + +# import + +from datetime import datetime +from random import randint + +\--- /code --- + +De uitvoer van jouw code verandert niet wanneer je deze uitvoert. + diff --git a/nl-NL/step_12.md b/nl-NL/step_12.md new file mode 100644 index 0000000..28f706f --- /dev/null +++ b/nl-NL/step_12.md @@ -0,0 +1,54 @@ +

Willekeurige getallen

+ +\--- task --- + +➡️ Kies een willekeurig getal voor de dobbelsteenworp. + +\--- /task --- + +Gebruik de `randint`-functie die je hebt geïmporteerd om een willekeurig getal tussen 1 en 6 te kiezen voor de dobbelsteenworp. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 12 +-------------------------------------------------------- + +# Functiedefinities + +def roll_dice(): +print(f'Je hebt een {randint(1, 6)} gegooid') + +\--- /code --- + +**Test:** Klik op de **Run** knop. +Wanneer je nu je code nog eens uitvoert, zal er elke keer een nieuw willekeurig getal tussen 1 en 6 worden gekozen. + +
+``` +Hallo 🌍🌎🌏 +Welkom bij Python 🐍 +Python 🐍 is goed in wiskunde! +12345678987654321 +De datum en tijd zijn 2023-11-21 16:02:12.535000 +Je hebt een 6 gegooid +``` +
+ +
+ +### Tip + +`randint` is de afkorting van random integer. Integers zijn gehele getallen. + +
+ +
+ +### Foutopsporing + +Controleer de haakjes en accolades als je een foutmelding krijgt. Houd er rekening mee dat hetzelfde nummer steeds opnieuw gekozen kan worden. Het is willekeurig! + +
diff --git a/nl-NL/step_13.md b/nl-NL/step_13.md new file mode 100644 index 0000000..e10e591 --- /dev/null +++ b/nl-NL/step_13.md @@ -0,0 +1,67 @@ +

Strings vermenigvuldigen

+ +\--- task --- + +➡️ Sla het willekeurige getal op in een variabele. +➡️ Vermenigvuldig het getal met de 🔥-emoji om de emoji een aantal keer af te drukken dat gelijk is aan de worp van de dobbelstenen. + +\--- /task --- + +In Python kun je strings zoals emoji's of hele woorden vermenigvuldigen met een getal, zodat ze meerdere keren worden geprint. + +Sla het willekeurige getal op in een variabele met de naam `roll`. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 12 +-------------------------------------------------------- + +# Functiedefinities + +def roll_dice(): +roll = randint(1,6) + +\--- /code --- + +Vermenigvuldig het willekeurige getal in `roll` met de 🔥 emoji en druk het resultaat af. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 13 +-------------------------------------------------------- + +# Functiedefinities + +def roll_dice(): +roll = randint(1,6) +print(f'Je hebt een {roll} {fire \* roll}') gegooid + +\--- /code --- + +**Test:** Klik op de **Run** knop. +Je uitvoer zou er ongeveer zo uit moeten zien: + +
+``` +Hallo 🌍🌎🌏 +Welkom bij Python 🐍 +Python 🐍 is goed in wiskunde! +12345678987654321 +De datum en tijd zijn 2023-11-21 16:14:45.140000 +Je hebt een 4 gegooid 🔥🔥🔥🔥 +``` +
+ +
+ +### Foutopsporing + +Controleer of alle haakjes hetzelfde zijn als in het bovenstaande codevoorbeeld. + +
diff --git a/nl-NL/step_14.md b/nl-NL/step_14.md new file mode 100644 index 0000000..3e42994 --- /dev/null +++ b/nl-NL/step_14.md @@ -0,0 +1,45 @@ +

Input ophalen

+ +\--- task --- + +➡️ Laat de persoon die jouw programma gebruikt, iets invoeren. + +\--- /task --- + +Met `input()` kun je de persoon die jouw programma gebruikt vragen om tekst in te voeren en deze tekst als variabele opslaan. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 12-13 +----------------------------------------------------------- + +# Functiedefinities + +def roll_dice(): +max = input('Hoeveel zijden heeft je dobbelsteen?:') +print(f'Dat is een D {max}') +roll = randint(1,6) +print(f'Je hebt een {roll} {fire \* roll}') gegooid + +\--- /code --- + +**Test:** Klik op de **Run** knop. +Zorg ervoor dat je op de knop Enter klikt nadat je het aantal kanten hebt ingevoerd. +Dit is wat je zou moeten zien wanneer je jouw code uitvoert. + +
+``` +Hallo 🌍🌎🌏 +Welkom bij Python 🐍 +Python 🐍 is goed in wiskunde! +12345678987654321 +De datum en tijd zijn 2023-11-21 16:20:41.323000 +Hoeveel zijden heeft je dobbelsteen?: +20 +Dat is een D 20 +Je hebt een 1 gegooid 🔥 +``` +
diff --git a/nl-NL/step_15.md b/nl-NL/step_15.md new file mode 100644 index 0000000..6e6881f --- /dev/null +++ b/nl-NL/step_15.md @@ -0,0 +1,54 @@ +

Verander de dobbelstenen

+ +\--- task --- + +➡️ Wijzig de invoergegevens naar een geheel getal. +➡️ Genereer een willekeurig getal tussen 1 en het aantal zijden dat de gebruiker heeft ingevoerd. + +\--- /task --- + +Invoer wordt altijd opgeslagen als tekst, maar we moeten de invoer in `max` gebruiken om het grootste getal op te geven dat kan worden gerold. + +`max` is een string en moet daarom worden gewijzigd naar een integer `int()`. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 14 +-------------------------------------------------------- + +# Functiedefinities + +def roll_dice(): +max = input('Hoeveel zijden heeft je dobbelsteen?:') +print(f'Dat is een D {max}') +roll = randint(1, int(max)) +print(f'Je hebt een {roll} {fire \* roll}') gegooid + +\--- /code --- + +**Test:** Klik op de **Run** knop. +Dit is wat je zou moeten zien: + +
+``` +Hallo 🌍🌎🌏 +Welkom bij Python 🐍 +Python 🐍 is goed in wiskunde! +12345678987654321 +De datum en tijd zijn 2023-11-21 16:27:24.101000 +Hoeveel zijden heeft je dobbelsteen?:12 +Dat is een D 12 +Je hebt een 5 gegooid 🔥🔥🔥🔥🔥 +``` +
+ +
+ +### Tip + +Het veranderen van het ene gegevenstype naar het andere gegevenstype wordt **type casting** genoemd. + +
\ No newline at end of file diff --git a/nl-NL/step_16.md b/nl-NL/step_16.md new file mode 100644 index 0000000..96bd202 --- /dev/null +++ b/nl-NL/step_16.md @@ -0,0 +1,38 @@ +

Nu ben jij aan de beurt

+ +\--- task --- + +➡️ Oefen met het toevoegen van meer `print`-regels aan je code. + +\--- /task --- + +Hier zijn enkele startzinnen die je kunt gebruiken: + +## --- code --- + +language: python +line_numbers: true +line_number_start: 23 +line_highlights: 24-26 +----------------------------------------------------------- + +roll_dice() +print(f'Ik ❤️ ...') +print(f'... maakt mij 😃') +print(f'Ik zou graag willen maken ... maken met {python}') + +\--- /code --- + +
+ +### Tip + +Hier is een lijst met emoji's die je zou kunnen gebruiken: + +🎊 🙌 🙌🏼 🙌🏽 🙌🏾 🙌🏿 😃 🕒 🎨 🎮 🔬 🎉 🕶️ 🎲 😊 +🦄 🚀 💯 ⭐ 💛 ❤️ 📚 ⚽ 🏏 🏀 🥋 🏆 ✨ 🥺 🌈 🔥 ♻️ 🌳 +👩‍🦽👩🏼‍🦽👩🏽‍🦽👩🏾‍🦽👩🏿‍🦽🧘 🧘🏼 🧘🏽 🧘🏾 🧘🏿 🙋 🙋🏼 🙋🏽 🙋🏾 🙋🏿 + +Je kunt ze kopiëren en plakken in jouw code. + +
diff --git a/nl-NL/step_17.md b/nl-NL/step_17.md new file mode 100644 index 0000000..67a65f5 --- /dev/null +++ b/nl-NL/step_17.md @@ -0,0 +1 @@ +## Reflectie \ No newline at end of file diff --git a/nl-NL/step_18.md b/nl-NL/step_18.md new file mode 100644 index 0000000..685e63f --- /dev/null +++ b/nl-NL/step_18.md @@ -0,0 +1,13 @@ +

Je hebt het project afgerond 🎉

+ +\--- task --- + +Wij horen graag wat jij vindt van het gebruik van de code-editor om het Hallo Wereld-project te voltooien! + +➡️ Vul ons [feedbackformulier](https://form.raspberrypi.org/4873648){:target="_blank"} in om ons dit te laten weten. + +### Wat nu? + +Als je het [Inleiding tot Python](https://projects.raspberrypi.org/en/raspberrypi/python-intro) pad volgt, kun je doorgaan naar het [Niet botsen](https://projects.raspberrypi.org/en/projects/target-practice) project. In dit project teken je een doelwit en maak je vervolgens een boogschietspel waarin de speler pijlen schiet om punten te scoren. + +\--- /task --- diff --git a/nl-NL/step_2.md b/nl-NL/step_2.md new file mode 100644 index 0000000..e23d6c2 --- /dev/null +++ b/nl-NL/step_2.md @@ -0,0 +1,39 @@ +

Variabelen

+ +
+ +### Tip + +Een **variabele** wordt gebruikt om waarden zoals tekst of getallen op te slaan. Als je een logische naam kiest voor een variabele, dan kun je later gemakkelijker onthouden waarvoor deze dient. + +
+ +We hebben enkele variabelen opgenomen die emoji-tekens opslaan. + +
+ +## --- code --- + +language: python +line_numbers: true +line_number_start: 3 +line_highlights: 4-6 +--------------------------------------------------------- + +# variabelen + +wereld = '🌍🌎🌏' +python = 'Python 🐍' +vuur = '🔥' + +# Functiedefinities + +# Zet de code om uit te voeren hier onder + +print(f'Hallo') + +\--- /code --- + +
+ + diff --git a/nl-NL/step_3.md b/nl-NL/step_3.md new file mode 100644 index 0000000..f194989 --- /dev/null +++ b/nl-NL/step_3.md @@ -0,0 +1,56 @@ +

Variabelen afdrukken

+ +\--- task --- + +➡️ De inhoud van een variabele afdrukken. + +\--- /task --- + +Wijzig je code zodat ook er een 'print()' wordt gedaan van de inhoud van de 'world' variabele. Je kan dit doen door de variabelenaam tussen accolades '{}' toe te voegen + +## --- code --- + +language: python +line_numbers: true +line_number_start: 3 +line_highlights: 11 +-------------------------------------------------------- + +# variabelen + +wereld = '🌍🌎🌏' +python = 'Python 🐍' +vuur = '🔥' + +# Functiedefinities + +# Zet de code om uit te voeren hier onder + +print(f'Hallo {world}') + +\--- /code --- + +**Test:** Klik op de **Run** knop. +Dit is wat je zou moeten zien wanneer je jouw code uitvoert. + +
+``` +Hallo 🌍🌎🌏 +``` +
+ +
+ +### Tip + +Met het teken 'f' in het print commando kun je eenvoudig variabelen samen met tekstreeksen afdrukken. + +
+ +
+ +### Foutopsporing + +Als je een foutmelding krijgt, controleer dan of je alle haakjes `()` en accolades `{}` hebt geopend en gesloten + +
diff --git a/nl-NL/step_4.md b/nl-NL/step_4.md new file mode 100644 index 0000000..99865e9 --- /dev/null +++ b/nl-NL/step_4.md @@ -0,0 +1,34 @@ +

Een andere variabele afdrukken

+ +\--- task --- + +➡️ De inhoud van de variabele `python` afdrukken. + +\--- /task --- + +**Voeg** nog een regel toe aan je code om meer tekst en emojis te 'print()'en: + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 12 +-------------------------------------------------------- + +# Zet de code om uit te voeren hier onder + +print(f'Hallo {world}') +print(f'Welkom bij {python}') + +\--- /code --- + +**Test:** Klik op de **Run** knop. +Dit is wat je zou moeten zien wanneer je jouw code uitvoert. + +
+``` +Hallo 🌍🌎🌏 +Welkom bij Python 🐍 +``` +
diff --git a/nl-NL/step_5.md b/nl-NL/step_5.md new file mode 100644 index 0000000..391c2da --- /dev/null +++ b/nl-NL/step_5.md @@ -0,0 +1,11 @@ +

Functies

+ +In Python kun je met getallen en data werken. Je kunt **rekenkundige operatoren** gebruiken, zoals '+' en '-' om berekeningen uit te voeren: + +\| + | optellen | +\| - | aftrekken | +\| \* | vermenigvuldigen | +\| / | delen | +\| \*\* | machtsverheffen | + + diff --git a/nl-NL/step_6.md b/nl-NL/step_6.md new file mode 100644 index 0000000..a4767be --- /dev/null +++ b/nl-NL/step_6.md @@ -0,0 +1,54 @@ +

Maak een berekening

+ +\--- task --- + +➡️ De waarde van een berekening afdrukken. + +\--- /task --- + +Voeg nog twee 'print()' regels toe aan je code, inclusief een vermenigvuldiging die Python moet berekenen: + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 13-14 +----------------------------------------------------------- + +# Zet de code om uit te voeren hier onder + +print(f'Hallo {world}') +print(f'Welkom bij {python}') +print(f'{python} is goed in wiskunde!') +print(f'{111111111 \* 111111111}') + +\--- /code --- + +**Test:** Klik op de **Run** knop. +Dit is wat je zou moeten zien wanneer je jouw code uitvoert. + +
+``` +Hallo 🌍🌎🌏 +Welkom bij Python 🐍 +Python 🐍 is goed in wiskunde! +12345678987654321 +``` +
+ +
+ +### Tip + +Python gebruikt dezelfde regels voor berekeningen die je op school hebt geleerd. BODMAS: **B**rackets (haakjes) eerst, dan **O**rders (machten), **M**ultiplication (vermenigvuldiging), **A**ddition (optellen) en als laatste **S**ubtraction (aftrekken). + +
+ +
+ +### Foutopsporing + +Vergeet niet dat HOOFDLETTERS en kleine letters belangrijk zijn in Python. Controleer altijd of je de juiste lettergrootte gebruikt. + +
diff --git a/nl-NL/step_7.md b/nl-NL/step_7.md new file mode 100644 index 0000000..319b3fa --- /dev/null +++ b/nl-NL/step_7.md @@ -0,0 +1,45 @@ +

Modules gebruiken

+ +\--- task --- + +➡️ Importeer de `datetime`-module. + +\--- /task --- + +Python heeft veel **modules** die je in jouw code kunt gebruiken om bepaalde taken uit te voeren. Om een module te kunnen gebruiken, moet je deze eerst **importeren**. + +De `datetime`-module helpt bij het schrijven van code die gebruikmaakt van datums en tijden. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 1 +line_highlights: 2 +------------------------------------------------------- + +# import + +from datetime import datetime + +# variabelen + +\--- /code --- + +Wanneer je deze code uitvoert, zou er niets moeten veranderen en zou je dezelfde uitvoer moeten krijgen als in de vorige stap. + +
+ +### Tip + +Elke tekst die je in Python schrijft met een `#` ervoor, wordt een opmerking. Deze regels worden niet uitgevoerd en kunnen daarom nuttig zijn om mensen te helpen jouw code te lezen en begrijpen. + +
+ +
+ +### Foutopsporing + +Controleer of je `datetime` correct hebt gespeld en of het alleen in kleine letters is. + +
diff --git a/nl-NL/step_8.md b/nl-NL/step_8.md new file mode 100644 index 0000000..b4f470f --- /dev/null +++ b/nl-NL/step_8.md @@ -0,0 +1,46 @@ +

Druk de datum af

+ +\--- task --- + +➡️ De huidige datum en tijd weergeven. + +\--- /task --- + +Voeg nog een regel toe aan je code om de huidige datum en tijd te 'print'-en. + +Haal de huidige datum en tijd op door de functie 'now()' uit de datetime -module te gebruiken: + +## --- code --- + +language: python +line_numbers: true +line_number_start: 14 +line_highlights: 16 +-------------------------------------------------------- + +print(f'{python} is goed in wiskunde!') +print(f'{111111111 \* 111111111}') +print(f'De datum en tijd zijn {datetime.now()}') + +\--- /code --- + +**Test:** Klik op de **Run** knop. +Dit is wat je zou moeten zien wanneer je jouw code uitvoert, maar de datum en tijd zullen anders zijn. + +
+``` +Hallo 🌍🌎🌏 +Welkom bij Python 🐍 +Python 🐍 is goed in wiskunde! +12345678987654321 +De datum en tijd zijn 2023-11-21 15:34:10.148000 +``` +
+ +
+ +### Foutopsporing + +Controleer alle haakjes `()` en accolades `{}` en zorg ervoor dat ze allemaal op de juiste plaats geopend en gesloten zijn. + +
diff --git a/nl-NL/step_9.md b/nl-NL/step_9.md new file mode 100644 index 0000000..c70f1f6 --- /dev/null +++ b/nl-NL/step_9.md @@ -0,0 +1,26 @@ +

Functies

+ +Functies zijn codeblokken die specifieke taken uitvoeren. Ze kunnen steeds opnieuw gebruikt worden. + +Hier is een voorbeeld van een functie: + +## --- code --- + +language: python +line_numbers: false +-------------------------------------------------------- + +# Functiedefinities + +def tel_een_en_een_op(): +x = 1 + 1 +print(x) + +\--- /code --- + +De naam van deze functie is 'tel_een_en_een_op\`. + +De code voor de taak die je wil dat de functie uitvoert, moet ingesprongen zijn, wat betekent dat je **vier spaties** moet toevoegen vóór elke regel code. + +Door een functie **aan te roepen**, wordt de code erbinnen uitgevoerd. Het **aanroepen** van een functie doe je door de naam in te typen. In dit geval 'tel_een_en_een_op()\`. + diff --git a/uk-UA/code/complete/main.py b/uk-UA/code/complete/main.py new file mode 100644 index 0000000..033545d --- /dev/null +++ b/uk-UA/code/complete/main.py @@ -0,0 +1,25 @@ +# imports +from datetime import datetime +from random import randint + +world = '🌍🌎🌏' +python = 'Python 🐍' +fire = '🔥' + +# Визначення функцій +def roll_dice(): + max = input('How many sides on your dice?:') + print(f'That is a D {max}') + roll = randint(1, int(max)) + print(f'You rolled a {roll} {fire * roll}') + +# Нижче розмісти код, який потрібно виконати +print('Привіт,' {world}') +print(f'Welcome to {python}') +print(f'{python} знається на математиці!') +print(f'{111111111 * 111111111}') +print(f'The date and time is {datetime.now()}') +roll_dice() # Виклич функцію, яка кидає кубик +print(f'I ❤️ ...') +print(f'... викликає у мене 😃') +print(f'I would like to make ... у {python}') diff --git a/uk-UA/code/complete/project_config.yml b/uk-UA/code/complete/project_config.yml new file mode 100644 index 0000000..0532e18 --- /dev/null +++ b/uk-UA/code/complete/project_config.yml @@ -0,0 +1,3 @@ +name: "Привіт, 🌍🌎🌏" +identifier: "editor-hello-world-complete" +type: 'python' diff --git a/uk-UA/code/starter/main.py b/uk-UA/code/starter/main.py new file mode 100644 index 0000000..159f9d3 --- /dev/null +++ b/uk-UA/code/starter/main.py @@ -0,0 +1,11 @@ +# imports + +# variables +world = '🌍🌎🌏' +python = 'Python 🐍' +fire = '🔥' + +# Function definitions + +# Put code to run under here + diff --git a/uk-UA/code/starter/project_config.yml b/uk-UA/code/starter/project_config.yml new file mode 100644 index 0000000..4d29ae1 --- /dev/null +++ b/uk-UA/code/starter/project_config.yml @@ -0,0 +1,3 @@ +name: "Привіт, 🌍🌎🌏" +identifier: "editor-hello-world-starter" +type: 'python' diff --git a/uk-UA/images/banner.png b/uk-UA/images/banner.png new file mode 100644 index 0000000..a6bd889 Binary files /dev/null and b/uk-UA/images/banner.png differ diff --git a/uk-UA/images/blue-points.png b/uk-UA/images/blue-points.png new file mode 100644 index 0000000..5768422 Binary files /dev/null and b/uk-UA/images/blue-points.png differ diff --git a/uk-UA/images/comma_error.png b/uk-UA/images/comma_error.png new file mode 100644 index 0000000..224bfe7 Binary files /dev/null and b/uk-UA/images/comma_error.png differ diff --git a/uk-UA/images/full_screen.png b/uk-UA/images/full_screen.png new file mode 100644 index 0000000..b45cc1f Binary files /dev/null and b/uk-UA/images/full_screen.png differ diff --git a/uk-UA/images/hello_error.png b/uk-UA/images/hello_error.png new file mode 100644 index 0000000..32d2a38 Binary files /dev/null and b/uk-UA/images/hello_error.png differ diff --git a/uk-UA/images/indent_error.png b/uk-UA/images/indent_error.png new file mode 100644 index 0000000..9874040 Binary files /dev/null and b/uk-UA/images/indent_error.png differ diff --git a/uk-UA/images/quiz1.png b/uk-UA/images/quiz1.png new file mode 100644 index 0000000..88df9a0 Binary files /dev/null and b/uk-UA/images/quiz1.png differ diff --git a/uk-UA/images/quiz2.png b/uk-UA/images/quiz2.png new file mode 100644 index 0000000..b39b5d8 Binary files /dev/null and b/uk-UA/images/quiz2.png differ diff --git a/uk-UA/images/quiz3.png b/uk-UA/images/quiz3.png new file mode 100644 index 0000000..af55813 Binary files /dev/null and b/uk-UA/images/quiz3.png differ diff --git a/uk-UA/images/roll_dice.png b/uk-UA/images/roll_dice.png new file mode 100644 index 0000000..4c274da Binary files /dev/null and b/uk-UA/images/roll_dice.png differ diff --git a/uk-UA/images/run_hello.png b/uk-UA/images/run_hello.png new file mode 100644 index 0000000..c89c369 Binary files /dev/null and b/uk-UA/images/run_hello.png differ diff --git a/uk-UA/images/run_hello_world.png b/uk-UA/images/run_hello_world.png new file mode 100644 index 0000000..653543c Binary files /dev/null and b/uk-UA/images/run_hello_world.png differ diff --git a/uk-UA/images/run_multiple.png b/uk-UA/images/run_multiple.png new file mode 100644 index 0000000..e1b8aa7 Binary files /dev/null and b/uk-UA/images/run_multiple.png differ diff --git a/uk-UA/images/say_hello.png b/uk-UA/images/say_hello.png new file mode 100644 index 0000000..e1b8aa7 Binary files /dev/null and b/uk-UA/images/say_hello.png differ diff --git a/uk-UA/images/sentence_starter.png b/uk-UA/images/sentence_starter.png new file mode 100644 index 0000000..c3d9b67 Binary files /dev/null and b/uk-UA/images/sentence_starter.png differ diff --git a/uk-UA/images/showcase_static.png b/uk-UA/images/showcase_static.png new file mode 100644 index 0000000..196c0cb Binary files /dev/null and b/uk-UA/images/showcase_static.png differ diff --git a/uk-UA/images/starter_project.png b/uk-UA/images/starter_project.png new file mode 100644 index 0000000..cc90493 Binary files /dev/null and b/uk-UA/images/starter_project.png differ diff --git a/uk-UA/images/sums_dates.png b/uk-UA/images/sums_dates.png new file mode 100644 index 0000000..574bc1f Binary files /dev/null and b/uk-UA/images/sums_dates.png differ diff --git a/uk-UA/images/upgrade_ideas.png b/uk-UA/images/upgrade_ideas.png new file mode 100644 index 0000000..53bcd64 Binary files /dev/null and b/uk-UA/images/upgrade_ideas.png differ diff --git a/uk-UA/meta.yml b/uk-UA/meta.yml new file mode 100644 index 0000000..b46b66c --- /dev/null +++ b/uk-UA/meta.yml @@ -0,0 +1,57 @@ +title: "Editor Hello \U0001F30D\U0001F30E\U0001F30F" +hero_image: images/banner.png +description: Створи інтерактивний проєкт на Python, який використовує емоджі +meta_title: Проєкти з кодування для дітей і підлітків | Привіт, світе +meta_description: Вивчай Python разом з Raspberry Pi Foundation. Створи інтерактивний проєкт мовою програмування Python з використанням емоджі. +version: 4 +listed: false +copyedit: false +last_tested: "2021-10-06" +steps: + - + title: step 1 + - + title: step 2 + completion: + - engaged + - + title: step 3 + - + title: step 4 + - + title: step 5 + - + title: step 6 + - + title: step 7 + - + title: step 8 + - + title: step 9 + - + title: step 10 + - + title: step 11 + - + title: step 12 + - + title: step 13 + - + title: step 14 + - + title: step 15 + - + title: step 16 + completion: + - internal + - + title: step 17 + knowledge_quiz: + path: quiz1 + version: 1 + questions: 3 + passing_score: 3 + - + title: step 18 + completion: + - external diff --git a/uk-UA/python-comments.txt b/uk-UA/python-comments.txt new file mode 100644 index 0000000..d2b55d6 --- /dev/null +++ b/uk-UA/python-comments.txt @@ -0,0 +1,43 @@ +Нижче розмісти код, який потрібно виконати + +Вивести результати обчислення сум + +Виведення емодзі + +Помісти сюди визначення функцій + +Не забуваймо про двокрапку в кінці цього рядка + +Виклик функції roll_dice + +Генерація випадкового числа від 1 до 6 + +Отримати значення змінної roll + +Повторення емодзі вогню, яке відповідає результату випадіння рандомного числа + +Очікування на введення даних від користувача + +Використання числа, яке ввів користувач + +randint повинен мати значення max, щоб бути 'цілим числом' + +Очікування натискання користувачем клавіші Enter + +Корисні символи :',()*_/.# + +Змінні емодзі для подальшого використання у твоєму проєкті + +Додай альтернативи ASCII-артів + +Раніше ми використовували смайлики, зроблені з символів + +отримати вхідні дані від користувача + +згенерувати випадкове число + +повторити ємодзі вогню відповідно до числа кубика + +отримати поточну дату та час + +Виклик функції hobbies diff --git a/uk-UA/python-translatable.txt b/uk-UA/python-translatable.txt new file mode 100644 index 0000000..91bd006 --- /dev/null +++ b/uk-UA/python-translatable.txt @@ -0,0 +1,101 @@ +Привіт + +Ласкаво просимо в ... + +...дуже добре справляється з ... + +...- + +...може зробити ... + +Тобі випало число: ... + +Скільки сторін буде мати кубик? + +Тип твого кубика: D ... + +Я <3 ... + +...робить мене ... + +Я хотів би зробити ... у ... + +awesome + +Я вмію кодувати + +two_dice + +Перше число: + +Друге число: + +хобі + +хобі + +Що тобі подобається? + +Це звучить ... + +Ти можеш створити ... проєкт про ... + +roll_dice + +roll + +тепер + +world + +суми + +календар + +годинник + +projects + +веселощі + +кубики + +єдиноріг + +space + +щасливий + +дурний + +серце + +ігри + +книги + +спорт + +green + +природи + +fire + +блискітки + +благати + +сто + +зірка + +жовте_серце + +веселка + +Обери найбільше число: + +I <3 веселки + +В яблучко - 500 балів! diff --git a/uk-UA/quiz1/question_1.md b/uk-UA/quiz1/question_1.md new file mode 100644 index 0000000..eb513f7 --- /dev/null +++ b/uk-UA/quiz1/question_1.md @@ -0,0 +1,89 @@ +## Вдосконалення твого проєкту + +## --- question --- + +## legend: Питання 1 з 3 + +This code sets the `world` variable to contain the text '🌍🌎🌏' (the three different world emoji): + +## --- code --- + +## language: python + +world = '🌍🌎🌏' + +\--- /code --- + +Which code correctly uses the `world` variable and outputs Hello 🌍🌎🌏? + +![The output area from the code editor with Hello 🌍🌎🌏 showing.](images/quiz1.png) + +\--- choices --- + +- ( ) + +## --- code --- + +## language: python + +output('Привіт,' world) + +\--- /code --- + +\--- feedback --- + +Not quite, `output` is not the way to output messages to the screen. + +\--- /feedback --- + +- ( ) + +## --- code --- + +## language: python + +print('Привіт' world) + +\--- /code --- + +\--- feedback --- + +Not quite, in Python `print` outputs messages to the screen, but something is missing in this example. + +\--- /feedback --- + +- (x) + +## --- code --- + +## language: python + +print('Привіт,' {world}') + +\--- /code --- + +\--- feedback --- + +That's correct, in Python `print(f'')` outputs messages to the screen. The text output is inside single quotes `'` , and curly braces `{}` are used to print the `world` variable. + +\--- /feedback --- + +- ( ) + +## --- code --- + +## language: python + +print('Hello {world}') + +\--- /code --- + +\--- feedback --- + +Not quite, in Python `print` outputs messages to the screen, but something is missing in this example. + +\--- /feedback --- + +\--- /choices --- + +\--- /question --- diff --git a/uk-UA/quiz1/question_2.md b/uk-UA/quiz1/question_2.md new file mode 100644 index 0000000..b3a9bac --- /dev/null +++ b/uk-UA/quiz1/question_2.md @@ -0,0 +1,64 @@ +## --- question --- + +## legend: Питання 2 з 3 + +Which of these function definitions is correct and will print `I can code` when called? + +![The code editor with output area showing I can code.](images/quiz2.png) + +\--- choices --- + +- (x) + +## --- code --- + +## language: python + +def awesome(): +print('I can code') + +\--- /code --- + +\--- feedback --- + +That's correct, calling this function will print `I can code`. You spotted that functions need `(` `)` brackets and a `:` in the function definition, and that all code to be run when that function is called must be indented. + +\--- /feedback --- + +- () + +## --- code --- + +## language: python + +def awesome(): +print('Я вмію кодувати') + +\--- /code --- + +\--- feedback --- + +Не зовсім так. Розташування рядків у цьому варіанті призведе до помилки. + +\--- /feedback --- + +- ( ) + +## --- code --- + +## language: python + +def awesome() +print('I can code') + +\--- /code --- + +\--- feedback --- + +Не зовсім так. У визначенні функції чогось не вистачає, і це може викликати помилку. + +\--- /feedback --- + +\--- /choices --- + +\--- /question --- diff --git a/uk-UA/quiz1/question_3.md b/uk-UA/quiz1/question_3.md new file mode 100644 index 0000000..35fddee --- /dev/null +++ b/uk-UA/quiz1/question_3.md @@ -0,0 +1,92 @@ +## --- question --- + +## legend: Питання 3 з 3 + +Ця функція виводить два випадкових числа: + +## --- code --- + +## language: python + +def two_dice(): +print('First number:', randint(1, 6)) +print('Second number:', randint(1, 6)) + +\--- /code --- + +Яким кодом можна викликати і запустити цю функцію? + +![The code editor with output area showing two randomly generated numbers.](images/quiz3.png) + +\--- choices --- + +- ( ) + +## --- code --- + +## language: python + +def two_dice(): +print('First number:', randint(1, 6)) +print('Second number:', randint(1, 6)) + +\--- /code --- + +\--- feedback --- + +Ні, це код визначає функцію, але не запускає її. Для виклику функції потрібен інший код. + +\--- /feedback --- + +- ( ) + \--- code --- + +--- + +## language: python + +two_dice + +\--- /code --- + +\--- feedback --- + +Майже! `two_dice` is the name of the function, but to call it you need more than just the name. + +\--- /feedback --- + +- () + +## --- code --- + +## language: python + +two_dice[] + +\--- /code --- + +\--- feedback --- + +Не зовсім так. Подумай про тип дужок, які ми використовували для виклику функцій у твоєму проєкті. + +\--- /feedback --- + +- (x) + +## --- code --- + +## language: python + +two_dice() + +\--- /code --- + +\--- feedback --- + +That's correct, using the function name followed by `(` `)` brackets will call the function. + +\--- /feedback --- + +\--- /choices --- + +\--- /question --- diff --git a/uk-UA/step_1.md b/uk-UA/step_1.md new file mode 100644 index 0000000..5cf9dc2 --- /dev/null +++ b/uk-UA/step_1.md @@ -0,0 +1,55 @@ +

Print Hello

+ +\--- task --- + +➡️ Display the word 'Hello' on the screen + +\--- /task --- + +In Python, `print()`{:.language-python} outputs strings (words or numbers) to the screen. + +Type the code to `print()`{:.language-python} Hello to the screen: + +
+ +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 11 +-------------------------------------------------------- + +# Нижче розмісти код, який потрібно виконати + +print(f'Привіт') + +\--- /code --- + +
+ +**Протестуй:** натисни на кнопку **Run**. +Ось що ти маєш побачити. + +
+``` +Привіт +``` +
+ +
+ +### Tip + +When you type an opening bracket `(`{:.language-python} the code editor will automatically add a closing bracket `)`{:.language-python} +This also happens when you type an opening apostrophe `'`{:.language-python}. + +
+ +
+ +### Debugging + +If you get an error then check your code really carefully. Check there are single quotes around `Hello`{:.language-python} so Python knows it is meant to be text. + +
diff --git a/uk-UA/step_10.md b/uk-UA/step_10.md new file mode 100644 index 0000000..ff66ddd --- /dev/null +++ b/uk-UA/step_10.md @@ -0,0 +1,73 @@ +

Roll dice

+ +\--- task --- + +➡️ Create a function to simulate rolling a dice. + +➡️ Call the function to run the code inside it. + +\--- /task --- + +Create a function called `roll_dice()`, that prints out the number 4. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 9 +line_highlights: 10, 11 +------------------------------------------------------------ + +# Визначення функцій + +def roll_dice(): +print(f'Тобі випало число {4}') + +# Нижче розмісти код, який потрібно виконати + +\--- /code --- + +Тепер виклич функцію під кодом. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 18 +line_highlights: 19 +-------------------------------------------------------- + +print(f'Дата й час — {datetime.now()}') +roll_dice() + +\--- /code --- + +**Протестуй:** натисни на кнопку **Run**. +Ось що ти маєш побачити. + +
+``` +Hello 🌍🌎🌏 +Welcome to Python 🐍 +Python 🐍 is good at maths! +12345678987654321 +The date and time is 2023-11-21 15:55:33.038000 +You rolled a 4 +``` +
+ +
+ +### Tip + +You can use the **Tab** key on your keyboard to insert 4 spaces. Pressing **Shift** and **Tab** will remove the 4 spaces. + +
+ +
+ +### Debugging + +Check that you have brackets `()` and a colon `:` at the end of your function definition. Also check you are using brackets `()` when you call your function. + +
diff --git a/uk-UA/step_11.md b/uk-UA/step_11.md new file mode 100644 index 0000000..9d71b92 --- /dev/null +++ b/uk-UA/step_11.md @@ -0,0 +1,27 @@ +

Import randint

+ +\--- task --- + +➡️ Import the `randint` function from the `random` module. + +\--- /task --- + +Another module called `random` can be used to create random numbers + +## --- code --- + +language: python +line_numbers: true +line_number_start: 1 +line_highlights: 3 +------------------------------------------------------- + +# imports + +from datetime import datetime +from random import randint + +\--- /code --- + +Your code output will not change when you run it. + diff --git a/uk-UA/step_12.md b/uk-UA/step_12.md new file mode 100644 index 0000000..6e1dc20 --- /dev/null +++ b/uk-UA/step_12.md @@ -0,0 +1,54 @@ +

Випадкові числа

+ +\--- task --- + +➡️ Choose a random number for the dice roll. + +\--- /task --- + +Use the `randint` function you imported to choose a random number between 1 and 6 for the dice roll. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 12 +-------------------------------------------------------- + +# Визначення функцій + +def roll_dice(): +print(f'Тобі випало число {randint(1, 6)}') + +\--- /code --- + +**Протестуй:** натисни на кнопку **Run**. +Щоразу як ти запускаєш код, вибиратиметься нове випадкове число від 1 до 6. + +
+``` +Hello 🌍🌎🌏 +Welcome to Python 🐍 +Python 🐍 is good at maths! +12345678987654321 +The date and time is 2023-11-21 16:02:12.535000 +You rolled a 6 +``` +
+ +
+ +### Tip + +`randint` is short for random integer. Integers are whole numbers. + +
+ +
+ +### Debugging + +Check your brackets and curly brackets if you get and error. Take note that the same number might be chosen over and over again. It's random! + +
diff --git a/uk-UA/step_13.md b/uk-UA/step_13.md new file mode 100644 index 0000000..85c3c7a --- /dev/null +++ b/uk-UA/step_13.md @@ -0,0 +1,67 @@ +

Multiply strings

+ +\--- task --- + +➡️ Store the random number in a variable. +➡️ Multiply the number by the 🔥 emoji to print the emoji a number of times equal to the dice roll. + +\--- /task --- + +У Python ти можеш помножити на якесь число рядки, наприклад емоджі або цілі слова, і вони виводитимуться кілька разів. + +Store the random number in a variable called `roll`. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 12 +-------------------------------------------------------- + +# Визначення функцій + +def roll_dice(): +roll = randint(1,6) + +\--- /code --- + +Multiply the random number stored in `roll` by the 🔥 emoji, and print the result. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 13 +-------------------------------------------------------- + +# Визначення функцій + +def roll_dice(): +roll = randint(1,6) +print(f'Тобі випало число {roll} {fire \* roll}') + +\--- /code --- + +**Протестуй:** натисни на кнопку **Run**. +Твій код на виході має виглядати приблизно так: + +
+``` +Hello 🌍🌎🌏 +Welcome to Python 🐍 +Python 🐍 is good at maths! +12345678987654321 +The date and time is 2023-11-21 16:14:45.140000 +You rolled a 4 🔥🔥🔥🔥 +``` +
+ +
+ +### Debugging + +Check all your brackets are the same as the code example above. + +
diff --git a/uk-UA/step_14.md b/uk-UA/step_14.md new file mode 100644 index 0000000..8c495fa --- /dev/null +++ b/uk-UA/step_14.md @@ -0,0 +1,45 @@ +

Отримай дані

+ +\--- task --- + +➡️ Allow the person using your program to type in some input. + +\--- /task --- + +You can use `input()` to ask the person using your program to enter text, and save it as a variable. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 12-13 +----------------------------------------------------------- + +# Визначення функцій + +def roll_dice(): +max = input('Кількість сторін кубика:') +print(f'Цей кубик називається D {max}') +roll = randint(1,6) +print(f'Тобі випало число {roll} {fire \* roll}') + +\--- /code --- + +**Протестуй:** натисни на кнопку **Run**. +Обовʼязково натисни клавішу введення (Enter) після того, як введеш кількість сторін. +Ось що ти маєш побачити. + +
+``` +Hello 🌍🌎🌏 +Welcome to Python 🐍 +Python 🐍 is good at maths! +12345678987654321 +The date and time is 2023-11-21 16:20:41.323000 +How many sides on your dice?: +20 +That is a D 20 +You rolled a 1 🔥 +``` +
diff --git a/uk-UA/step_15.md b/uk-UA/step_15.md new file mode 100644 index 0000000..4719a91 --- /dev/null +++ b/uk-UA/step_15.md @@ -0,0 +1,54 @@ +

Change the dice

+ +\--- task --- + +➡️ Change the input data to an integer. +➡️ Generate a random number between 1 and the number of sides the user typed in. + +\--- /task --- + +Inputs are always stored as text, but we need to use the input stored in `max` to specify the largest number that could be rolled. + +`max` is a string, so it needs changing to an integer `int()`. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 14 +-------------------------------------------------------- + +# Визначення функцій + +def roll_dice(): +max = input('Кількість сторін кубика:') +print(f'Цей кубик називається D {max}') +roll = randint(1, int(max)) +print(f'Тобі випало число {roll} {fire \* roll}') + +\--- /code --- + +**Протестуй:** натисни на кнопку **Run**. +This is what you should see: + +
+``` +Hello 🌍🌎🌏 +Welcome to Python 🐍 +Python 🐍 is good at maths! +12345678987654321 +The date and time is 2023-11-21 16:27:24.101000 +How many sides on your dice?:12 +That is a D 12 +You rolled a 5 🔥🔥🔥🔥🔥 +``` +
+ +
+ +### Tip + +Changing one type of data to another type of data is called **type casting**. + +
\ No newline at end of file diff --git a/uk-UA/step_16.md b/uk-UA/step_16.md new file mode 100644 index 0000000..c68a0d0 --- /dev/null +++ b/uk-UA/step_16.md @@ -0,0 +1,38 @@ +

Over to you

+ +\--- task --- + +➡️ Practice adding more `print` lines to your code. + +\--- /task --- + +Ось приклади речень, які ти можеш використати для початку: + +## --- code --- + +language: python +line_numbers: true +line_number_start: 23 +line_highlights: 24-26 +----------------------------------------------------------- + +roll_dice() +print(f'I ❤️ ...') +print(f'... makes me 😃') +print(f'I would like to make ... у {python}') + +\--- /code --- + +
+ +### Tip + +Ось список емоджі, які ти можеш використати: + +🎊 🙌 🙌🏼 🙌🏽 🙌🏾 🙌🏿 😃 🕒 🎨 🎮 🔬 🎉 🕶️ 🎲 😊 +🦄 🚀 💯 ⭐ 💛 ❤️ 📚 ⚽ 🏏 🏀 🥋 🏆 ✨ 🥺 🌈 🔥 ♻️ 🌳 +👩‍🦽👩🏼‍🦽👩🏽‍🦽👩🏾‍🦽👩🏿‍🦽🧘 🧘🏼 🧘🏽 🧘🏾 🧘🏿 🙋 🙋🏼 🙋🏽 🙋🏾 🙋🏿 + +You can copy and paste them into your code. + +
diff --git a/uk-UA/step_17.md b/uk-UA/step_17.md new file mode 100644 index 0000000..dc521db --- /dev/null +++ b/uk-UA/step_17.md @@ -0,0 +1 @@ +## Поміркуй \ No newline at end of file diff --git a/uk-UA/step_18.md b/uk-UA/step_18.md new file mode 100644 index 0000000..98c8358 --- /dev/null +++ b/uk-UA/step_18.md @@ -0,0 +1,13 @@ +

Проєкт завершено 🎉

+ +\--- task --- + +We’d love to hear your thoughts about using the Code editor to complete the Hello World project! + +➡️ Please complete our [feedback form](https://form.raspberrypi.org/4873648){:target="_blank"} to let us know. + +### Що далі? + +If you are following the [Introduction to Python](https://projects.raspberrypi.org/en/raspberrypi/python-intro) pathway, you can move on to the [Target practice](https://projects.raspberrypi.org/en/projects/target-practice) project. In this project, you will draw a target then make an archery game where the player shoots arrows to score points. + +\--- /task --- diff --git a/uk-UA/step_2.md b/uk-UA/step_2.md new file mode 100644 index 0000000..93a80c0 --- /dev/null +++ b/uk-UA/step_2.md @@ -0,0 +1,39 @@ +

Змінні

+ +
+ +### Tip + +A **variable** is used to store values such as text or numbers. Choosing a sensible name for a variable makes it easier for you to remember what it is for. + +
+ +Ми вже додали декілька змінних, які зберігають емоджі. + +
+ +## --- code --- + +language: python +line_numbers: true +line_number_start: 3 +line_highlights: 4-6 +--------------------------------------------------------- + +# змінні + +world = '🌍🌎🌏' +python = 'Python 🐍' +fire = '🔥' + +# Визначення функцій + +# Нижче розмісти код, який потрібно виконати + +print(f'Привіт') + +\--- /code --- + +
+ + diff --git a/uk-UA/step_3.md b/uk-UA/step_3.md new file mode 100644 index 0000000..a3874ce --- /dev/null +++ b/uk-UA/step_3.md @@ -0,0 +1,56 @@ +

Print variables

+ +\--- task --- + +➡️ Print the contents of a variable. + +\--- /task --- + +Change your code to also `print()` the contents of the `world` variable. You can do this by adding the variable name in curly brackets `{}` + +## --- code --- + +language: python +line_numbers: true +line_number_start: 3 +line_highlights: 11 +-------------------------------------------------------- + +# змінні + +world = '🌍🌎🌏' +python = 'Python 🐍' +fire = '🔥' + +# Визначення функцій + +# Нижче розмісти код, який потрібно виконати + +print('Привіт,' {world}') + +\--- /code --- + +**Протестуй:** натисни на кнопку **Run**. +Ось що ти маєш побачити. + +
+``` +Hello 🌍🌎🌏 +``` +
+ +
+ +### Tip + +The `f` character inside the print lets you easily print variables along with strings of text. + +
+ +
+ +### Debugging + +If you get an error then check you have opened and closed all your brackets `()` and curly brackets `{}` + +
diff --git a/uk-UA/step_4.md b/uk-UA/step_4.md new file mode 100644 index 0000000..bc918f8 --- /dev/null +++ b/uk-UA/step_4.md @@ -0,0 +1,34 @@ +

Print another variable

+ +\--- task --- + +➡️ Print the contents of the `python` variable. + +\--- /task --- + +**Add** another line to your code to `print()` more text and emojis: + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 12 +-------------------------------------------------------- + +# Нижче розмісти код, який потрібно виконати + +print(f'Привіт, {world}') +print(f'Ласкаво просимо до {python}') + +\--- /code --- + +**Протестуй:** натисни на кнопку **Run**. +Ось що ти маєш побачити. + +
+``` +Hello 🌍🌎🌏 +Welcome to Python 🐍 +``` +
diff --git a/uk-UA/step_5.md b/uk-UA/step_5.md new file mode 100644 index 0000000..60e8726 --- /dev/null +++ b/uk-UA/step_5.md @@ -0,0 +1,11 @@ +

Оператори

+ +У Python можна працювати з числами та датами. You can use **arithmetic operators** such as `+` and `-` to do calculations: + +\| + | add | +\| - | subtract | +\| \* | multiply | +\| / | divide | +\| \*\* | exponent | + + diff --git a/uk-UA/step_6.md b/uk-UA/step_6.md new file mode 100644 index 0000000..a401bec --- /dev/null +++ b/uk-UA/step_6.md @@ -0,0 +1,54 @@ +

Create a calculation

+ +\--- task --- + +➡️ Print the value of a calculation. + +\--- /task --- + +Add two more `print()` lines to your code including a multiplication for Python to calculate: + +## --- code --- + +language: python +line_numbers: true +line_number_start: 10 +line_highlights: 13-14 +----------------------------------------------------------- + +# Нижче розмісти код, який потрібно виконати + +print(f'Привіт, {world}') +print(f'Ласкаво просимо до {python}') +print(f'{python} знається на математиці!') +print(f'{111111111 \* 111111111}') + +\--- /code --- + +**Протестуй:** натисни на кнопку **Run**. +Ось що ти маєш побачити. + +
+``` +Hello 🌍🌎🌏 +Welcome to Python 🐍 +Python 🐍 is good at maths! +12345678987654321 +``` +
+ +
+ +### Tip + +Python uses the same rules for calculations as you might have learned at school. **B**rackets first, then **O**rders, **D**ivision, **M**ultiplication, **A**ddition, and lastly **S**ubtraction. + +
+ +
+ +### Debugging + +Don't forget that the UPPERCASE and lowercase letters are important in Python. Always check you are using the correct case. + +
diff --git a/uk-UA/step_7.md b/uk-UA/step_7.md new file mode 100644 index 0000000..68a6b40 --- /dev/null +++ b/uk-UA/step_7.md @@ -0,0 +1,45 @@ +

Using modules

+ +\--- task --- + +➡️ Import the `datetime` module. + +\--- /task --- + +Python has many **modules** that you can use in your code to help perform certain tasks. To use a module, you first need to **import** it. + +The `datetime` module helps with writing code that uses dates and times. + +## --- code --- + +language: python +line_numbers: true +line_number_start: 1 +line_highlights: 2 +------------------------------------------------------- + +# imports + +from datetime import datetime + +# змінні + +\--- /code --- + +When you run this code, nothing should change, and you should have the same output as the previous step. + +
+ +### Tip + +Any text you write in Python with a `#` in front of it becomes a comment. These lines won't run, so they can be useful to help people read and understand your code. + +
+ +
+ +### Debugging + +Check that you have spelled `datetime` correctly, and it is all lowercase. + +
diff --git a/uk-UA/step_8.md b/uk-UA/step_8.md new file mode 100644 index 0000000..b809177 --- /dev/null +++ b/uk-UA/step_8.md @@ -0,0 +1,46 @@ +

Print the date

+ +\--- task --- + +➡️ Display the current date and time. + +\--- /task --- + +Add another line to your code to `print` the current date and time. + +Get the current date and time by using the `now()` function from the `datetime` module: + +## --- code --- + +language: python +line_numbers: true +line_number_start: 14 +line_highlights: 16 +-------------------------------------------------------- + +print(f'{python} знається на математиці!') +print(f'{111111111 \* 111111111}') +print(f'Дата й час — {datetime.now()}') + +\--- /code --- + +**Протестуй:** натисни на кнопку **Run**. +This is what you should see when you run your code, but the date and time will be different. + +
+``` +Hello 🌍🌎🌏 +Welcome to Python 🐍 +Python 🐍 is good at maths! +12345678987654321 +The date and time is 2023-11-21 15:34:10.148000 +``` +
+ +
+ +### Debugging + +Check all your brackets `()` and curly brackets `{}` to make sure they are all opened and closed in the correct place. + +
diff --git a/uk-UA/step_9.md b/uk-UA/step_9.md new file mode 100644 index 0000000..c25c1d4 --- /dev/null +++ b/uk-UA/step_9.md @@ -0,0 +1,26 @@ +

Функції

+ +Функції — це блоки коду, які виконують певні завдання. Їх можна використовувати знову і знову. + +Ось приклад функції: + +## --- code --- + +language: python +line_numbers: false +-------------------------------------------------------- + +# Визначення функцій + +def add_one_and_one(): +x = 1 + 1 +print(x) + +\--- /code --- + +The name of this function is `add_one_and_one`. + +The code for the task you want the function to do needs to be **indented**, which means that you need to add **four spaces** before each line of code. + +**Calling** a function runs the code inside it. You **call** a function by using its name. In this case `add_one_and_one()`. +