[Tutor] Center Grove Student Mentoring Question

Martin A. Brown martin at linux-ip.net
Fri Apr 8 22:13:24 EDT 2022


> My name is Gavin, and I am a 7th grade student at Center Grove 
> Middle School Central in Greenwood, IN.

Welcome!  You have definitely reached a decent cross-section of 
Python practitioners by emailing this list.  And, thank you for 
introducing yourself and framing your question.

> In my LA class, we are working on a project called "Genius Hour." 

I'm also not sure what "LA class" might be.  Language Arts?

> For this project, we are asked to choose a topic that we are 
> passionate about. One component of this project is seeking a 
> mentor who can help answer questions about the topic we chose. 
> That is why I'm reaching out to you. My topic for my Genius Hour 
> Project is how to code. I was hoping you could answer some 
> questions that I have regarding my project.

> 1. Are there any specific websites/videos that I can use to help 
>    me learn python?

Tons.  The wealth of options boggles the mind.

  * https://docs.python.org/3/tutorial/
  * https://www.w3schools.com/python/
  * 
Concomitant with the rise of the Internet came email distribution 
lists (like this), newsgroups (now less common), discussion forum 
technology, and distributed software development, and an 
increasing interest in open source software.

Why do I mention that now?  Python grew amid these sociocultural 
features and is a lovely example of cooperative, non-hierarchical 
development of software languages.

One of the many results is tons of material, both available for sale 
(books, courses) and also freely available (examples above, 
including Alan Gauld's posting).

What you have found here, Gavin, is a bunch of people who really 
enjoy Python and look forward to the opportunity to share it with 
others who wish to learn.  The list is geared toward specific "how 
do I solve this problem" or "how do I understand this Python 
concept" as well more general questions like yours.

Lastly, your question is "are there any specific websites/videos 
that I can use to help me learn python".... yes, we could probably 
each send you dozens, or scores of possibilities!

I will also point out that you might find a similar response if you 
were to send a similar question to a group of people who were 
interested in other programming languages such as Java, C, Rust, 
Ruby, Javascript, Go and many others.  Of course, since we are all 
denizens of the Python list, we are geared to tell you about the 
joys and wonders of Python!

> 2. What are some useful tips for beginners?

Practice, practice, practice.  Read, read, read.

One of my general top suggestion for anybody trying to write 
anything in any (new-to-them) programming language is to already 
have a project, task, challenge in mind.  Here are some examples, 
but this can and should be something that interests you.

  * Fetch and display some content from a website.
  * Re-encode all sound / songs from one format to another.
  * Write a chat bot.
  * Write a temperature controller for an oven/smoker.

(I knew one person whose choice was to write an IRC server to learn 
a new language, and another who would write a fractal generator.)

Once you know what you want to write.... don't start there directly, 
but figure out what things you need to do in the new language and 
write a bunch of "toys".  This is the practice that allows you to 
you pick up the skills by writing "toy" programs or exercises that 
allow you to practice your mental facility with the required 
features of the language (data structures, how to read or write 
files, how to print text, draw graphics, send or receive data from a 
network, perform computations on things).

Feel free to throw away the toys when you are done or keep them if 
you wish (I keep mine in a folder called ~/python/learning/).  If 
one toy, concept or language feature is hard, step away from it for 
a day or so and practice on some other toys or language features.

Some common "toys" that I have written in several languages I have 
learned:

  * Open a file, read it into memory print it to screen.  "cat"
  * Open a file, read it line by line, print matching lines "grep"
  * Compute the circumference of a circle from its radius.
  * Fetch content from a website and print out one specific thing.
  * Get the computer to create a "bag" of 1000 marbles of different 
    random colors and then count the number of each color.

Then go find and read other examples of your successful toys.  Find 
examples where other people solved similar problems.  Note!  This is 
hard work, reading somebody else's programs, but it is also a 
valuable skill, just like reading somebody else's letter, article or
book.  By reading, you may see how somebody else did that thing that 
you were having trouble with.

Then, practice re-writing the toys to get better, clearer, shorter, 
faster.  This is like all practice:  running, throwing darts, 
juggling, riding horses -- practicing these things is like working 
on your form in javelin toss or swimming.  The more you can write 
the toys effortlessly, the more you find that you can assemble 
things that are no longer toys.

If you were learning French, you might learn two different ways to 
express the same idea.

This is very useful for a beginner because every human language and 
programming language captures and express ideas differently.  And, 
sometimes you might say:  "Shall we go to dinner?" and other times 
you might say "Yo, let's get some grub!"  And, it takes awareness 
and practice to know when to say each of those things.

If you know the circumstances and people very well, it could be 
appropriate to say the latter.  If you don't know the circumstances 
and people, you might choose the former option, which is a bit more 
formal.

Programming languages often do something similar.  If you know your 
data, say, in this case a dictionary that might (or might not) have 
a record of distances for each javelin thrower at a track meet:

  # -- grab "distances" from "data" (dictionary)... if not present
  #    use a list with 0 meters ...
  #
  max_meters = max(data.get('distances', [0]))

  # -- here, we know "distances" key exists in "data"
  #
  max_meters = max(data['distances'])

The point is that usually there are several acceptable ways to solve 
a problem, even in very simple toy problems, so you can practice 
using the different techniques.  This is similar to learning to 
suggest a prandial outing.

(No, I'm not suggesting you take Python to a candlelit dinner, 
although who knows what it might tell you about floats, strings, 
iterators and the occasional Exception?)

> 3. If there was one thing you knew before coding, what would it be?

I'm assuming this is "if there one thing you wish you knew before 
coding" ....

A most difficult question to answer, so I will leave this for 
others.

 * I frequently find colleagues teaching me the relevance of a new 
   way to look at a question or a problem.  So don't forget that the 
   learning mode with computers never stops.... so you can 
   absolutely discover what you don't yet know and take the time to 
   learn it then.

 * Such a big topic that I'm not sure how to answer, but I will say 
   that I re-learn frequently that patience when learning new 
   languages and touching new computer systems is warranted.

> Thank you so much for taking the time to read my email. I hope you 
> will be able to help me. If possible, would you please respond to 
> this email by Friday, April 23rd? I look forward to hearing from 
> you. If you have any questions regarding my project, you can 
> contact me or my LA teachers at the following email addresses:

I hope my answers and those from others on the mailing list help you 
in your project.

Good luck, Gavin, and thank you for your courteous request to the 
mailing list.

-Martin

-- 
Martin A. Brown
http://linux-ip.net/


More information about the Tutor mailing list