Python is one the most popular language for learning coding today, and I have been using it successfully in my computer science elective classes for grades 7 and 8.
Python is a text based language without the fussy semicolons and curly braces and variable declarations that can be so difficult to use for younger middle school students. Since Python is also widely used in industry, students are happy to be learning a 'real programming language' as they call it, and there are TONS of resources available online.
We also use the micro:bit if there is time in the class and they are able to use MicroPython to code and use their Python skills in a different setting.
What do I actually use in my Python classroom and Why?
I use Python 3, and I use it with IDLE in the computer labs at my schools. IDLE is an offline editor and development environment that comes for free with the Python download. Using this setup means that my students have to create files using the naming conventions I give them, make folders, back up files and submit their solutions to me on the school server (I use a simple script to grade them as a batch). In addition to teaching them some of these basic file management skills, they are also not distracted by other things online. They tend to stay more on task using the offline IDLE environment. I may switch to a more full featured editor like PyCharm in future classes.
Python Code-Along
I teach Python by introducing basic coding concepts using small snippets of code (usually run in the shell) and then doing a 'Code-along' to build a small project that will use the new concept. Students code along with me, and participate by contributing/ suggesting / guessing what to add to the project. At the end, each student has a working project.
Python Coding Challenge Sets
Each new concept Code-Along session is followed by students working on a set of coding challenges. These are a set of 5-10 projects that are leveled tasks that provide them with plenty of choice, and opportunities to be creative and extend projects as needed. I customize the project set based on the class level/interest to make sure there is enough interesting and challenging tasks for all students.
Here are some sample coding challenges that could be part of a first Challenge Set - these involve ideas of input, output, variables, data types
Here are some challenges that involve using lists, and loops
(Hint: Use a for loop to print menu. Use the random module to get the prices
Make it look nice if you want an extra challenge.
Yes- you can change the list to different foods ! )
(Optional challenge) Ask the user for a food to replace in the above Breakfast list, and what to replace it by, and then change it and print the new list
6. Given a list of student names ( use from our class or make up the names) as a list , exampleStudents = [ ‘john’, ‘susan’ ]
Use for loop and
1)Print list of names one per line.
2) Find the number of students name begins with ‘a’ and print the total
3) find the % of students name begins with ‘a'
4) find average length of name
7. Write a program that takes a list of high scores separated by , as input, and then prints the lowest score, and the highest score. Extra : print the average of the numbers.
HINT: Use the following to take information and split it based on the ,
userInput = input(‘Enter high scores’)
scoresList = userinput.split(‘,’)