User Tools

Site Tools


atelier:coding_gouter:pedagogique:ppour:introduction

This is an old revision of the document!


Introduction

This is introduction into learning how to program. For this journey we will your Ppour which is French translator to Python, which is kind of Python, but with French keywords. The idea why is like that, so you can concentrate on learning how to program, and don't study English at the same time. If you know English very-very well, obviously Python is fine to learn, and it can be used to following material as it is.

So what programming is? I would say this is an art of telling computer what to do very very precisely. Unfortunately computers not smart, and where they looks smart they are may decieve you. So you should learn how to think in very small steps, so you can verify each step independently and check how computers doing their job.

Example of the program

afficher("=== Nous effectuons des calculs ===")
afficher("ajout 1 + ...+ 10 = ", 1+2+3+4+5+6+7+8+9+10)
afficher("factorielle 10 =", 1*2*3*4*5*6*7*8*9*10)
afficher("somme de fractions = 1/2 + 1/4 + 1/5 =", 1/2 + 1/4 + 1/5)
afficher("somme des carrés = 3^2 + 4^2 = 5^2 =", 3*3 + 4*4, " = ", 5*5)
afficher("grands nombres = un billion ^ 2 =", 1000000000000 * 1000000000000)
afficher("grands nombres plus simples =", 2e12 * 3e12)
afficher("10307 n'est pas simple =", 10307/11, " * ", 11)
afficher("15% de réduction sur 12345 = ", 15/100*12345)
afficher("Peut donner des résultats inexacts:")
afficher("lorsqu'on travaille avec de grands nombres =", 1234567890 * 1234567890)
afficher("lorsqu'on travaille avec des fractions: 1/2 + 1/3 + 1/6 =", 1/2 + 1/3 + 1/6)
afficher("avec des décimales: 0.1+0.1+0.1+0.1+0.1+0.1+0.1+0.1 =", 0.1+0.1+0.1+0.1+0.1+0.1+0.1+0.1)
afficher("et d'autres cas: 3.2 - 0.3 =", 3.2 - 0.3)
atelier/coding_gouter/pedagogique/ppour/introduction.1776855175.txt.gz · Last modified: by Andrii Kurdiumov