PyParis -- How we used Python to introduce teenagers to the fun of programming
1. Syrine Krichene
Software Engineer @ Criteo
How we used Python to introduce
teenagers to the fun of
programming
Anne-Marie Tousch
Research Scientist @Criteo
@amy8492
3. 3 •
• Women under-representation is a fairly
recent phenomenon
• Many women programmers throughout
history
• We want the young people to embark!
Stereotypes vs. reality
4. 4 •
• Meet women engineers
• Visit our Criteo Paris office
• Have fun & get some swag
• Actually write some code
A day to discover computer
science jobs
5. 5 •
Preparing the coding part
• Discover computer science
• Motivate career choice in computer
science
18. 18 •
• Have fun
-> Play Games
-> Win the Game
-> Be the best at your game !
• Be creative:
-> change the game's set up
-> change the rules
-> change the graphics
...
Have fun
&
Be creative
19. 19 •
• Simple functions
for loops
if conditions
Discover a real
programming language
for i in range(3):
print(“Hi ”, i)
Hi 0
Hi 1
Hi 2
0 1 2
for i in range(3):
print(“Hi ”, i)
Hi 0
Hi 1
Hi 2
0 1 2for i in range(3):
print(“Hi ”, i)
Hi 1
Hi 2
0 1 2for i in range(3):
print(“Hi ”, i) Hi 2
0 1 2for i in range(3):
print(“Hi ”, i)
0 1 2
20. 20 •
• Simple functions
for loops
if conditions
• Using libraries: Kivy
Learn to look for information on the web!
read the documentation
Discover a real
programming language
24. 24 •
• Create games:
Action on clicks
Animation
Graphics
Frame displays
Widget interactions (master and slave)
Progress
Game hacking
Discover computer science
topics
25. 25 •
Apply what you already know
• Physics
Use positions to check collisions
Increase the speed
• Math
Use variables to automate changes
• Logic
Realistic animation
Scoring rules
• Geometry and drawings
Create the widgets graphics
26. 26 •
• Workshop + presentation
• Increase difficulty
• Discover different parts of the game
• Let's hack and play the game !
Progress
28. 28 •
• Teens love Snapshat & Instagram
• Even basic image processing is
fun
• Use the webcam for immediate
feedback
Get creative
29. 29 •
• Powered by Kivy & Numpy
• Boosted with OpenCV
• GUI to ease testing
• Commented in french
Python
main.py
transforms.py
30. 30 •
• Digital images
• Use RGB color system to
create custom colorizations
Image processing
31. 31 •
• Draw rectangles
• Draw flags
• Combine effects
• Use OpenCV…
… AI inside !!!
From simple to complex
Demo time!
32. 32 •
• The image coordinate system
• How do you draw a star?
Maths to the rescue
33.
34. 34 •
Students
« avoir passé une journée chez Criteo m'a apporté bien plus que je
ne l’imaginais. »
« j'ai particulièrement aimé cette joie qui nous
a été communiquée, jointe à l'envie de créer et
de programmer en découvrant de nouvelles
choses. »
37. 37 •
• Contact CGénial if you want to participate
• Checkout our code on https://github.com/criteo/je-code-crazy-filters
We’re doing it again soon!
2$ Problem, stats
- We need more (women) developers
- We need to motivate young people to go learn programming
=> 1ere to choose ISN, 2de to choose S/ISN, etc.
=> target High school
3$ context on the journee je code / why this?
- We need to motivate young people to go learn programming
=> 1ere to choose ISN, 2de to choose S/ISN, etc.
=> target High school
Ada Lovelace
Margaret Hamilton, Grace Hopper
4$ context: how ?
- We are all role models
=> share our love of coding
=> show it's obvious programming makes for a good career for women
Event conception:
- full day
- showcase different jobs in computer science, as can be seen at Criteo
- visit the office
- actually write some code ! => prepare some exercises
=> OK, how do you do that
5$ Main goal: discover computer science!
6$ Constraint = Time - make sure it goes well in one hour and a half
7$ What we check / Preparing the environment
8$ No bug - Setup and check the machines to make sure everything runs smoothly. Playground already running on all the machines. One machine per person.
9$ Mentoring - Lots of teachers, more like mentors, helpers: close to pair programming. No-one must be blocked.
- incentive to ask questions.
10$ Exercise Design Principles:
11$ Have fun! - Playful! Creative! *F* => music, image, games, etc. related to the tech they use / immediate feedback, don't wait to see what the code does / quick iterations
12$ Discover a real programming language - Learn some Python (for, if, functions, variables, parameters...). Read/write real code. Not a closed environment (not Scratch). Code like adults. Why Python / easy and realistic and rich ecosystem / multipurpose -- *P* logos-Python
13$ Discover computer science topics - Learn something new, discover a computer topic. Don't hide the complexity. Not a closed environment (not Scratch). Code like adults. *CS* robot/games/instagram mashup
14$ Apply your knowledge - Build on what you know - Use what they learn in high school. Useful, interesting. *M* Schoolteacher & an equation (physics, math class)
15$ Progress - Smooth progression. make sure they don't get blocked / they understand what they do / feeling they learn. *S* psychological aspect / feel good effect / eureka
16$ ColorSwitch
17$ F - game choice
17$ F - game choice
18$ P - simple functions, for loops, etc. / using Kivy (cross-platform, game tools,...)
- Learn to look for information on the web!
- read the documentation on the web
18$ P - simple functions, for loops, etc. / using Kivy (cross-platform, game tools,...)
- Learn to look for information on the web!
- read the documentation on the web
19$ CS - Game design: time, frames & the notion of discrete time
19$ CS - Game design: time, frames & the notion of discrete time
19$ CS - Game design: time, frames & the notion of discrete time
19$ CS - Game design: time, frames & the notion of discrete time
14$ Apply your knowledge - Build on what you know - Use what they learn in high school. Useful, interesting. *M* Schoolteacher & an equation (physics, math class)
21$ S - Debugging, a bug is not a big deal (introducing bugs to help understanding)
22$ Crazy-filters
23$ F - Infinite Creativity with image processing / Snapshat & Instagram inspiration/success with teens
- Immediate feedback
24$ P
- Kivy for the UI, OpenCV bindings,
- numpy arrays abstracting the image details
- functions binded to buttons
- restart & iterate
- « Lego blocks »: everything works at the click of a button
25$ CS –
Introduction to digital images: the RGB color system => how to create a color?
What is the difference vs. creating paint colors?
27$ S - using and modifying more and more complex functions
26$ M - the coordinate system, trigonometry => drawing a flag
Conclusion
28$ Positive feedback from students: When they realise they can take control of the code and do *whatever they want*. This is when we have won victory: we want them to be autonomous and creative, and start changing the code and creating with their own ideas. You know they'll want to continue.
29$ Positive feedback from the teachers: found the exercise difficult (different notion of exercise / less pre-conceptions, biases)
30$ Our analysis:
- close mentoring is super helpful (but there are still a few exceptions left behind... math horror!)
- competition helps creativity
31$ Next iteration is Nov. 30th (Criteo) / Contact CGenial / download the code on Github