最初的问题

我目前正在教我弟弟编程。他完全是个初学者,但很聪明。(他真的很想学)。我注意到我们的一些会议陷入了一些小细节,我觉得我不是很有条理。(但这篇文章的答案有很大帮助。)

我怎样才能更好地有效地教他?是否有一个逻辑顺序,我可以用一个概念一个概念地运行?是否有什么复杂的问题我应该在以后再讨论?

我们正在使用的语言是Python,但任何语言的建议都是受欢迎的。


如何提供帮助

如果你有好的答案,请在你的答案中添加以下内容:

初级练习和项目想法 初学者教学资源 屏幕视频/博客文章/免费电子书 印刷适合初学者的书籍

请用链接描述资源,以便我可以看一看。我想让每个人都知道,我确实在使用其中的一些想法。你提交的内容将在这篇文章中汇总。


初学者在线教学资源:

A Gentle Introduction to Programming Using Python How to Think Like a Computer Scientist Alice: a 3d program for beginners Scratch (A system to develop programming skills) How To Design Programs Structure and Interpretation of Computer Programs Learn To Program Robert Read's How To Be a Programmer Microsoft XNA Spawning the Next Generation of Hackers COMP1917 Higher Computing lectures by Richard Buckland (requires iTunes) Dive into Python Python Wikibook Project Euler - sample problems (mostly mathematical) pygame - an easy python library for creating games Invent Your Own Computer Games With Python Foundations of Programming for a next step beyond basics. Squeak by Example Snake Wrangling For Kids (It's not just for kids!)


推荐印刷书籍的教学初学者

加速c++ Python编程绝对初学者 Charles Petzold编写的代码 Python编程:计算机科学介绍第二版


当前回答

There have already been a bunch of great answers, but for an absolute beginner, I would wholeheartedly recommend Hackety Hack. It was created by the unreasonably prolific why_the_lucky_stiff specifically to provide a BASIC/LOGO/Pascal-like environment for new programmers to experiment in. It's essentially a slick Ruby IDE with some great libraries (flash video, IM, web server) and interactive lessons. It makes a good pitch for programming, as it chose lessons that do fun, useful things. "Hello, world" may not impress right off the bat, but creating a custom IM client in 20 minutes can inspire someone to keep learning. Have fun!

其他回答

我不知道怎样对你弟弟最好,但我知道我是从蟒蛇开始的。我从很小的时候就开始玩各种各样的游戏,并想要制作自己的游戏,所以我的叔叔用pygame库向我介绍了python。它有很多教程,让一切都很简单(在我看来比openGL简单多了)。 它仅限于2d,但你应该从简单开始。

我的叔叔推荐python,因为他当时对它很感兴趣,但我推荐它,现在已经相当有知识了,因为它很容易学,直观(或像编程语言一样直观),而且简单(但肯定不简单)。

当时我个人觉得简单地学习编程非常无聊,但随着学习的深入,我又有了相当大的热情。我真的很想学习是为了创造一些东西,而不仅仅是学习。

其他几个起步平台:

一个好的可编程计算器(这是我在70年代学到的),HP25, HP41,现在TI69等等。 像“Inform 7”这样的互动小说平台提供了另一种视角 Flash / ActionScript

所有这些都是不同的,引人入胜的,其中任何一个都可能激发一种兴趣,这是跑步初学者所必需的。

LBB

无论你选择哪种语言和环境,如果学生是出于专业原因或“真正的”编程(不管那是什么)而学习,让他们先在纸上写下他们的初始程序,然后带着它们去运行。返回输出和/或错误结果,并让他们在纸上修复错误。

刚开始,这并不比在屏幕上执行并点击运行更难,但当他们开始发现bug的奇妙世界时,事情会变得容易得多。

1)简短地说:“你好,世界!”-type仍然有一些逻辑和/或计算的程序,对一些可能有bug的程序这样做

Python的挑战

我认为Python是个好主意。我会给他一些基本的任务让他自己去做,并告诉他,他遇到的任何死胡同都可以通过谷歌来解决。至少对我来说,自己解决问题总比别人告诉我解决方案更好。

一些可能的项目(排名不分先后):

Coin flip simulator. Let the user input a desired number of trials for the coin flipping. Execute it and display the results along with the percentage for heads or tails. Make a temperature converter with a menu that takes user input to choose which kind of conversion the user wants to do. After choosing the conversion and doing it, it should return to the main menu. Here's an example of an extended converter with the same idea: http://pastebin.org/6541 Make a program that takes a numeric input and displays the letter grade it would translate to. It'll end up evaluating the input against if and elif statements to find where it fits. Make a simple quiz that goes through several multiple choice or fill in the blank questions. At the end it will display how the user did. He can pick any questions he wants. Take an input of some (presumably large) number of pennies and convert it into bigger denominations. For example, 149 pennies = 1 dollar, 1 quarter, 2 dimes, and 4 pennies. Create a simple list manager. Be able to add/delete lists and add/delete entries in those lists. Here's an example of a christmas list manager: http://pastebin.org/6543 Create a program that will build and then test whether entered numbers form a magic square (with a 2D array). Here's some sample code, but it should really print out the square at each step in order to show where the user is in terms of buliding the square: http://pastebin.org/6544

我还建议用xTurtle或其他图形模块做一些事情,把事情混合起来,让他不会感到无聊。当然,这是非常多的实践编程,而不是很多人真正使用python的脚本,但我给出的例子几乎直接取自我通过python学习的时候,它对我来说非常有用。好运!