Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 668427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:02:18+00:00 2026-05-14T00:02:18+00:00

I am teaching Python to undergraduate math majors. I am interested in the optimal

  • 0

I am teaching Python to undergraduate math majors. I am interested in the optimal order in which students should be introduced to various Python concepts. In my view, at each stage the students should be able to solve a non-trivial programming problem using only the tools available at that time. Each new tool should enable a simpler solution to a familiar problem. A selection of numerous concepts available in Python is essential in order to keep students focused. They should also motivated and should appreciate each newly mastered tool without too much memorization. Here are some specific questions:

  • For instance, my predecessor introduced lists before strings. I think the opposite is a better solution.
  • Should function definitions be introduced at the very beginning or after mastering basic structured programming ideas, such as decisions (if) and loops (while)?
  • Should sets be introduced before dictionaries?
  • Is it better to introduce reading and writing files early in the course or should one use input and print for most of the course?

Any suggestions with explanations are most welcome.

Edit: In high school the students were introduced to computers. A few of them learned how to program. Prior to this they had a course, covering word, excel, powerpoint, html, latex, a taste of Mathematica, but no programming. 5 years ago I used Mathematica in this course and the follow-up course uses C and later Java. Now I teach introduction to Python and in the follow-up course my colleague teaches object-oriented programming in Python. Later a student may take special courses on data structures, algorithms, optimization and in some elective courses they learn on their own Mathematica, Matlab and R.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:02:19+00:00Added an answer on May 14, 2026 at 12:02 am

    After some try / except as a teacher, I chose to stick to something like:

    (starting from nothing, adjust to their level)

    1. Shortly, what is Python and what you can do with it. Skip the speech on technical stuff and focus on what they want to do : music, GUI, Web site, renaming files, etc.
    2. Installing Python, running the interpreter. If you can, use iPython.
    3. Variables, basic strings and print().
    4. Int and types (including type errors and casting).
    5. Basic calculus. Show them 1 / 0, 10 / 3 but don’t bother them with details.
    6. Putting calculus results in variables.
    7. Using variables in calculus.
    8. String formating with %. Show only “%s”, it’s enough and always works. Always use a tuple (with an ending coma), even if it contains only one item.
    9. Lists, indexing, slicing and common errors. Then show tuples as frozen lists (and casting). Show that then can contain each others. Make them work on that until they master it perfectly: this is very, very important.
    10. Dictionaries, with common errors. Nesting with tuples and lists. Insist on the last point.
    11. For loop on strings, then lists, then tuples, then dictionaries.
    12. For loop on nested types. Be nasty. Take your time. Knowing that part well changes everything.
    13. Dictionary items(), values() and keys().
    14. Reading files using for, including IOErrors.
    15. Writing files.
    16. Using methods. Use a string as an example showing strip(), lower(), split(), etc. Don’t explain OOP, just how to use a method. Use the world “method” a lot from now.
    17. Creating a module file and using it. One module only. Everything in it.
    18. Functions (only with return, no print(). Forbid print() in functions).
    19. Function parameters.
    20. Named parameters.
    21. Default value parameters.
    22. Try / Except and exceptions.
    23. Import and creation of your own directory modules. Show all the special cases (it takes way more time to explain it than you think).
    24. Demonstrate some standard modules (but don’t spend too much time on it, it’s just to show): datetime, string, os and sys. Avoid abstract stuffs like itertools, they are a coder dream but a student nightmare.

    After that you can bring OOP on the table, but it a bit more complicated. Use strings, lists and files to introduce the notion of object. When they got it, start with classes. Then may the force be with you 🙂

    It is tempting to use print in functions to show how it works, and even more tempting to use raw_input. You should avoid it at all cost. The first one makes it very difficult to bring the concept of a “returned value”, the second hides the real flow of a program and students have a hard time to understand that you need to chain functions, not ask the user for every value you need.

    Generally, choose one method that works for something and stick to it. Don’t show alternative ways. E.g:

    Show only string formating using %, and ignore + and ,. You can always add a little “going further” block in your lecture material for the ones who want to know more. Show only for and not while. You can code almost 90% of Python programs without while. Avoid +=. Don’t show that you can multiply strings/lists/dict with ints. This is not wrong, but will lead them to misconception. You need them focused on the main concepts.

    Don’t show sets. Sets are very useful but rarely used. Encourage them to code at home and to ask you if they can’t solve a problem. In that case show sets if they are the solution. Knowing sets take times and student brain resources that could be used for something more often used. They will have plenty of time to learn new tools later, without you: focus on what is hard or time consuming to learn alone.

    Same goes for enumerate. Students with a C or a Java background will use indexes to loop instead of for if you give them enumerate. For similar reasons, keep len, fd.read, fd.realines and range for one of the last courses entitles “advanced python” if you have any time for it.

    Don’t even think about generators, metaclasses and decorators. These can be apprehended by very few students, even after months of practice. List comprehensions, with and ternary operations can be brought in some of the last courses if you feel your students are smart arses.

    Eventually, enforce good practices arbitrarily. PEP8 formating, good architecture, name conventions, no immutable default parameters, etc. They just can’t know about it right now. Don’t bother, you are the teacher, you have the right to say “this is just how it is” from time to times.

    Oh, and they will be better programmers if they don’t start by learning things like bytecode, recursion, assembly, complexity, bubble sort, stack, implementation details, etc. You waste time teaching this to somebody that can’t code a decent Python program, he just can’t see what’s this is all about. Practice is your best tools to bring theory. And again, they will learn everything else by them-self later if you prepare them correctly, so prioritize and and don’t be afraid to skip concepts, even simple/important ones.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am teaching myself some Python and I have come across a problem which
I've been teaching myself Python at my new job, and really enjoying the language.
I'm thinking of implementing a configuration file written in Python syntax, not unlike what
I have been teaching myself JS and Jquery primarily for GM scripts (im not
Are there good references teaching you how to send PUT/DELETE/POST/GET with ruby? I have
I'm teaching myself C with K&R and am stumped by one of the examples
I’m teaching an entry-level C++ programming class. We only use iostream in the class
I'm teaching myself Objective-C as a guilty pleasure, if you would. I have a
I've been slowly teaching myself the fundamentals of interface driven programming and I'm struggling
I'm teaching myself techniques of programming with exception safety mode of ;) and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.