Empowering the Next Generation of Leaders in Technology

by Clara Quigley

Opex Analytics
The Opex Analytics Blog
7 min readOct 4, 2019

--

One of our core values at Opex Analytics is education (we love to educate through our blogs and academy sessions), so we are always excited by opportunities to educate youth in STEM (science, technology, engineering, and mathematics) fields. Not only do we enjoy helping out, but we like to work with and volunteer for other organizations who share our values. That’s why we were so proud to partner with TechGirlz and Unilever to teach middle school girls to code.

Techgirlz, an organization Opex has partnered with in the past, is driven to inspire middle school girls to explore technology, gain confidence, and consider careers in tech. They provide free lesson plans (called “TechShopz”) on technical topics for volunteers who want to get involved.

We were excited for our first such TechGirlz partnership with Unilever, as they share our commitment to expanding opportunities for women in tech. Kelechi Idika, a procurement manager and part of the Supplier Diversity Program at Unilever, told us:

Core to Unilever is the belief that empowering women can transform the world, and we live this message through our commitment to enhancing opportunities for women and girls. One way to bring this to life was partnering with Opex Analytics to teach middle school girls to code with Python. By doing so, we hope to encourage them to consider careers in STEM-related areas where we see women underrepresented today.

We had a record turnout — 33 girls!

The goal of this workshop was not only to teach the girls specific skills in Python, but also to get them excited about the possibilities of working in STEM. In this post, I’ll walk you through the great day we spent with the girls at Unilever’s North American headquarters.

97 Steps to a PB&J

To kick off the workshop, Gabriella Runnels, a data scientist here at Opex, led the girls in a game that gets them into the coding mindset.

In this game, called “97 Steps to a PB&J”, Gabriella acts as the “computer” and the girls are the computer’s “programmers” tasked with instructing the computer to assemble a peanut butter and jelly sandwich.

The trick is that she has to follow everything they say extremely literally. Gabriella explains:

If they tell me to open the bag of bread, but they don’t tell me exactly how, I just rip it open and let the bread fly everywhere. They pretty quickly catch on that they have to be very explicit with their instructions — ‘Place your left hand on the bread bag and grip it; using your right hand, untwist the bread tie in a counter-clockwise motion; carefully place the bread tie on the table; reach your right hand into the bag and gently pull out two slices of bread.’

Opex data scientist Gabriella Runnels as a “computer”

We did this exercise for a couple of reasons. First, it’s a lot of fun — the girls really enjoy seeing an adult make a mess with food, and it’s a great icebreaker for the beginning of the day. Second, it encourages them to make mistakes, which is one of the workshop’s key lessons. If throwing jelly on the floor is okay today, so is trying to run a block of code — even if it might not work. Last, it provides a (very memorable) explanation of how computers interpret instructions. The difference between “Print” and “print” actually matters! Gabriella explains, “When we dive into the Python lesson, we can use the PB&J example to remind the girls why syntax matters, give them hints on how to debug their code, and help them understand the basic steps it takes to create a working program.”

The Work(shop)

With the icebreaker completed, we dove into the instructional part of the workshop. This part is the most like school — the girls learn about math, data types, if statements, and all the other basic stuff you need to know to be able to code.

We had two fantastic teachers: Sanjeevni Wanchoo, a Solution Architect at Opex, and Dave Marmor, a data scientist at Unilever. Sanjeevni taught the girls how to do basic math in Python (and how it can help them with homework!), as well as the fundamentals of data types. After Sanjeevni wrapped up, Dave then taught the girls about specific Python data types (booleans, lists and if statements).

The lesson is partly a traditional lecture and partly filled with engaging exercises for the girls to do on their own or in small groups. Each girl had access to a computer, with all relevant code set up in a Jupyter notebook, an interactive document that combines human-readable text and Python code. The notebooks allow the girls to experiment on their own, but not get left behind if their syntax isn’t perfect.

While Dave and Sanjeevni went through the lecture, volunteers walked around to help debug the girls’ errors and answer questions. One of the best parts of these workshops is getting to see the volunteers interact with the girls. For this workshop, we were lucky to have sixteen total volunteers from Opex and Unilever. Our volunteers were able to easily connect with the girls, and readily encouraged them to make mistakes.

Tristan Dresbach, a data scientist at Unilever and one of the volunteers, also found the interactions with the girls meaningful:

It was an absolute joy to be able to teach and watch the girls learn in the space of a day. Their ability to assimilate concepts [and then] immediately turn around and utilize them was quite impressive and a lot of fun to aid and watch in real-time.

Unilever data scientist Tristan Dresbach helps with debugging

Unilever HQ

After getting through some of the basics of coding, we took a tour of the Unilever North American HQ. The tour started with the test kitchen, where chefs simulate restaurant and home kitchens to test all kinds of Unilever products, from Hellman’s mayo to Knorr side dishes. We got to see the company store, the cafeteria, the employee gym, and the entire main workspace. The tour focused on the steps Unilever has taken to reduce and eventually eliminate its carbon footprint, including removing single-use silverware in the cafeteria and installing smart lighting that reduces energy consumption.

Many of the girls told us they were very impressed by the space. Participant Surbhi Rawal said, “I found the architectural design and interior designing impressive. I appreciate Unilever’s approach on making products more green and earth-friendly.”

Tour stop outside the test kitchen

When we got back to the classroom, we served some of Unilever’s finest products: ice cream (both vegan and regular) from Talenti, Breyers, and Ben and Jerry’s. While the girls ate their ice cream, we showed them an app that Opex built with Unilever to predict orders from an e-commerce customer. The app scrapes the web to pull information from a customer portal, then adds data from an internal data source, and finally trains a Quantile Random Forest Regressor model — all in Python! We showed them the source code and pointed out the elements that they’d learned already, but most of the girls were pretty focused on their ice cream at that point, and we certainly couldn’t fault them for that.

Kelechi Idika (Unilever) and Andy Fox (Opex) serving ice cream

Let’s Play a Game!

We ended the workshop with one final exercise: the girls had to code a simple game. The game involves a secret number, with players trying to guess what the number is. Though it seems simple, it’s actually a bit tricky, and forces the girls to put all of their new knowledge to work.

We started with a blank cell and talked through the game’s essential elements. The simplest form of this game is only four lines of code.

guess = int(input())
secret_number = 7
if secret_number == guess:
print("Congratulations, you got it!")

This simple version incorporates all the main elements the girls learned throughout the day: there are variables to store information, a type change, a comparison of two variables using an operator, and an if statement to control the flow of the program.

Once we’d shown them the simple version, we added more and more layers of complexity to enhance the game. The final product had loops, multiple comparisons, and even gives users hints!

import random
keep_guessing = True
secret = random.randint(1,10)
while keep_guessing:
guess = int(input())
if secret == guess:
print("Congrats! You got it")
keep_guessing = False
elif secret > guess:
print("Close… try higher")
else:
print("Close… try lower")

One girl took it even further, turning it into a game where users guess animals. If you guess incorrectly, the game returns alliterative animal phrases. All the girls in her corner were having a ball trying to think of animals that start with “C” to add to the program.

Photo by Krysten Merriman from Pexels

Every time I finish helping out with a TechGirlz workshop, I feel inspired by how much the girls have learned in just a few hours. I didn’t start coding until my senior year of college, and I’m always struck by how far along these girls are on their technology journey. Many thanks to TechGirlz for making these workshops accessible, to Unilever for hosting the event, and to everyone involved for inspiring the next generation of women in tech!

_________________________________________________________________

If you liked this blog post, check out more of our work, follow us on social media (Twitter, LinkedIn, and Facebook), or join us for our free monthly Academy webinars.

--

--