background preloader

The "Invent with Python" Blog

The "Invent with Python" Blog
I frequently see a problem when people (especially techies) try to teach programming to someone (especially non-techies). Many programming tutorials begin with basic programming principles: variables, loops, data types. This is both an obvious way to teach programming and almost certainly a wrong way to teach programming. It’s wrong because nobody wants to learn how to program. If you are teaching a class of adults who are paying with their own money for an education, then this is an appropriate and direct way to teach programming. But for the casually interested or schoolchildren with several activities competing for their attention, programming concepts like variables and loops and data types aren’t interesting in themselves. Here are my five pieces of advice to people who want to teach programming or create programming tutorials: 1. But people can feel the limitations that these programs have. 2. 3. I began learning BASIC in the third grade. 4. 5. Enough said.

Learn Python in 10 minutes NOTE: If you would like some Python development done, my company, Stochastic Technologies, is available for consulting. This tutorial is available as a short ebook. The e-book features extra content from follow-up posts on various Python best practices, all in a convenient, self-contained format. All future updates are free for people who purchase it. Preliminary fluff So, you want to learn the Python programming language but can't find a concise and yet full-featured tutorial. Properties Python is strongly typed (i.e. types are enforced), dynamically, implicitly typed (i.e. you don't have to declare variables), case sensitive (i.e. var and VAR are two different variables) and object-oriented (i.e. everything is an object). Getting help Help in Python is always available right in the interpreter. >>> help(5)Help on int object:(etc etc) >>> dir(5)['__abs__', '__add__', ...] >>> abs. Syntax Python has no mandatory statement termination characters and blocks are specified by indentation. Strings

A National Tragedy - What Teens Aren't Being Taught A lot of interesting things have happened to me over the years - fodder for stories. Today as I was reflecting about what parents do and do not teach their teens, I remembered one of those gems. I was 22 years old, and it was the morning after my bride and I had returned from our honeymoon road trip out West. "I don't know. I decided to keep it simple and easy. Then she told me she wasn't sure how to cook fried eggs. At the time, I didn't ask myself why this was so. But sometime later I did reflect on that. And then: Her mother was a gourmet cook. Today, I think a lot about the things that teenagers don't learn. And of course that isn't true. Imagine the enormous advantage a teen would have if he or she was coached in these areas before starting a career! I've talked to hundreds of adults about their teen years, and only one told me that he received anything like "the talk." Yes, it's a "full plate," as I like to put it. These are the people I write for. Post by Dennis E.

Teaching kids how to write computer programs, by Marshall Brain by Marshall Brain Quick Intro - If you are looking for a quick and easy way to teach your kid a real programming language, without downloading anything or buying anything, try these Python tutorials. Your kid will be writing and modifying code in just a few minutes. Marshall Brain's quick and easy Python tutorials Let's say that you have children, and you would like to help them learn computer programming at a youngish age. As the father of four kids, I have tried to approach it from several different angles. Let's start with a something important: Every kid is different. The second thing to realize is that real analytical skills often don't start appearing until age 11 or 12 or 13 in many kids, so expecting huge breakthroughs prior to that may be unrealistic. That being said, there are lots of fun things you can try as early as five or six... Games Let's start with a few games. Then there is this game, which actually does a very good job of teaching simple programming skills: Python for Kids

Python - Notes You have seen how you can reuse code in your program by defining functions once. What if you wanted to reuse a number of functions in other programs that you write? As you might have guessed, the answer is modules. There are various methods of writing modules, but the simplest way is to create a file with a .py extension that contains functions and variables. Another method is to write the modules in the native language in which the Python interpreter itself was written. A module can be imported by another program to make use of its functionality. Example (save as module_using_sys.py): import sys print('The command line arguments are:')for i in sys.argv: print i print '\n\nThe PYTHONPATH is', sys.path, '\n' $ python module_using_sys.py The command line arguments are: module_using_sys.py we are arguments The PYTHONPATH is ['/tmp/py', # many entries here, not shown here '/Library/Python/2.7/site-packages', '/usr/local/lib/python2.7/site-packages'] How It Works 11.1. 11.2. 11.3. 11.4. 11.5.

20 verktyg för stora och små nybörjare | Kom så ska vi koda! Sedan jag började blogga om olika sätt att lära sig programmera har jag stött på ett stort antal verktyg och resurser, avsedda för nybörjare i olika åldrar. En del har jag hittat via andra bloggar, artiklar och Twitterinlägg. En del har ni läsare/följare tipsat om. Några har jag själv blivit riktigt förtjust i, och puffat för i tidigare inlägg. Andra har jag bara testat lite grann och vissa har jag ännu inte hunnit prova alls. De här verktygen har nu blivit så många att jag känner att det är dags att sammanställa dem i en lista (inte minst för min egen skull, så att jag inte glömmer bort något). 1. Scratch är ett visuellt programspråk och ett utvecklingsverktyg. 2. Snap, eller Build Your Own Blocks som verktyget tidigare kallades, är en vidareutveckling (”extended reimplementation”, heter det på hemsidan) av Scratch. 3. Tynker är ännu en Scratch-variant, som i skrivande stund bara är tillgänglig för skolor men som ”snart” (enligt hemsidan) ska släppas för privatpersoner. 4. 5. 6. 7. 8.

Python beginner's mistakes Every Python programmer had to learn the language at one time, and started out as a beginner. Beginners make mistakes. This article highlights a few common mistakes, including some I made myself. Beginner's mistakes are not Python's fault, nor the beginner's. To put it another way, the mistakes in this article are often cases of "the wrong tool for the job", rather than coding errors or sneaky language traps. Mistake 1: trying to do low-level operations Python is sometimes described as a VHLL, a Very High-Level Language. This doesn't mean that it isn't possible to do these things with Python; but it's probably just not the right language for these jobs. Mistake 2: writing "language X" code in Python This is a mistake that is almost unavoidable. Some notorious symptoms of "language X" code, and the languages that may cause them: The point here is not to slam the language that you're used to (although that is always fun ;-). This one requires some clarification. Some advice

Kom så ska vi koda! | Tips och tankar om programmering för barn och andra nybörjare. The Django Book Coding in the Classroom: A Long-Overdue Inclusion One need not look to superstars such as Mark Zuckerberg or Bill Gates to justify reasons for using code and programming logic in the classroom. There's plenty of literature that illustrates its positive learning outcomes. Coding in the classroom is linked to improved problem solving and analytical reasoning, and students who develop a mastery of coding have a "natural ability and drive to construct, hypothesize, explore, experiment, evaluate, and draw conclusions." But there are other compelling reasons for integrating code in the classroom. Reasons to Teach Coding 1. Wired Magazine reported that reading and writing code is the new literacy. 2. Coding in the classroom is a means of bridging the digital divide. 3. Temple Grandin, author and professor at Colorado State University and an autistic adult, said, "Without the gifts of autism, there would probably be no NASA or IT industry." Knowing there are programs for kids with ASD is good news for parents who shoulder the responsibility. 4.

Learning with Python Navigation How to Think Like a Computer Scientist¶ Learning with Python¶ 2nd Edition (Using Python 2.x) by Jeffrey Elkner, Allen B. Last Updated: 21 April 2012 Copyright NoticeForewordPrefaceContributor ListChapter 1 The way of the programChapter 2 Variables, expressions, and statementsChapter 3 FunctionsChapter 4 ConditionalsChapter 5 Fruitful functionsChapter 6 IterationChapter 7 StringsChapter 8 Case Study: CatchChapter 9 ListsChapter 10 Modules and filesChapter 11 Recursion and exceptionsChapter 12 DictionariesChapter 13 Classes and objectsChapter 14 Classes and functionsChapter 15 Classes and methodsChapter 16 Sets of ObjectsChapter 17 InheritanceChapter 18 Linked ListsChapter 19 StacksChapter 20 QueuesChapter 21 TreesAppendix A DebuggingAppendix B GASPAppendix c Configuring Ubuntu for Python DevelopmentAppendix D Customizing and Contributing to the BookGNU Free Document License Search Page © Copyright 2010, Jeffrey Elkner, Allen B.

What Does It Take to Do Computer Programming? Phenomenographic studies in computing education research have previously focused on learning "programming thinking" [3], the act of learning to program [2], and conceptions of learning generally in an engineering context [10]. In the present study we analyze and discuss "what it takes to do computer programming" using phenomenography as research approach. This study is based on a large survey dataset gathered in summer outreach courses for K-12 students. The analysis resulted in 12 qualitatively different categories belonging to five separate, emergent themes: Syntax and language features, nature of programming work generally, computational thinking and problem solving, prerequisites, and auxiliary skills. We additionally reviewed whether the students' previous experience explains the categories, and observed that a mechanistic view of programming was prevailing among the inexperienced users, while experienced students more often stressed algorithmic thinking and logical reasoning.

Related: