跳过主要导航

What is programming?

There are many different definitions of programming, but Martin O'Hanlon's is simple. Watch his video to find out the three basic structures.

What is programming?

There are countless definitions of what computer programming is, but here is mine.

“编程是如何youget computers to solve problems.”

这里有两个关键短语很重要:

  • : without the programmer (you), the computer is useless. It does whatyou告诉它做。
  • 解决问题:计算机是工具。诚然,它们是复杂的工具,但并不是神秘或神奇的:它们的存在是为了使任务更容易。

计算机程序使计算机工作

计算机程序(或软件)是使计算机工作的原因。没有软件,现代计算机只是将电力转化为热量的复杂机器。它是计算机上运行您的操作系统,浏览器,电子邮件,游戏,电影播放器​​的软件 - 几乎所有内容。

编程很有创造力

编程是一项创造性的任务:以相同的方式解决问题没有正确或错误的方法,没有对或错误的绘画方法。

There are choices to be made, and one way may seem better than another, but that doesn’t mean the other is wrong! With the right skills and experience, a programmer can craft software to solve an unlimited number of problems – from telling you when your next train will arrive at playing your favourite music.

The possibilities are constrained only by your imagination. That’s why I love programming.

屏幕上出现文本的计算机卡通动画gif。1.转弯并面对悬崖2.走向悬崖3.停在悬崖边缘4.跳下悬崖

When you create a program for a computer, you give it a set of instructions, which it will run one at a time in order, precisely as given. If you told a computer to jump off a cliff, it would!

1.转弯并面对悬崖2.走向悬崖3.停在悬崖边缘4.跳下悬崖

To stop computers from constantly falling off cliffs, they can also make choices about what to do next:

If I won't survive the fall, don't jump off the cliff

Computers never get bored and are really good at doing the same thing over and over again. Instruction 2 above might look in more detail like this:

2a。左脚向前2B。右脚向前2C。回到2A

An animated GIF of a cartoon computer walking forwards, repeatedly taking a step with one foot and then with the other.

These three concepts are the basic logical structures in computer programming:

    1. 顺序: running instructions in order

    1. Selection:做出选择

    1. 重复:多一次做同样的事情,也称为迭代

除了这些概念,可以处理输入和输出并存储数据,并且您拥有解决所有计算问题的工具。

编程语言

不幸的是,计算机不了解英语或西班牙语等语言,因此我们必须使用programming language他们理解给他们指示。

有许多不同的编程语言,所有这些语言都有自己的优点,并且某些语言更适合特定类型的任务,但是没有一种语言是“最好的”。

In this course, you will be programming using a language called Python. Python is one of a group of languages called “general-purpose programming languages”, which can be used to solve a wide variety of problems. Other popular languages in this category are C, Ruby, Java and BASIC.

This is a small Python program that asks the user to enter their name and says “Hi” to them:

print(“你好,欢迎光临。”)name=input("Whats your name?")如果name==“马丁”:print("Thats my name too!")print("Hi "+name)

你don’t need to be a computer programmer to be able to read this code. It contains English words and it is readable (if not perhaps understandable). However, by the end of this course you will understand this code, what it does, and the concepts it uses.

Programs are often referred to as代码因此编程也被称为coding.

This article is from the free online

编程101:教育工作者Python简介

Created by
FutureLearn - Learning For Life

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

我们认为,学习应该是一种愉快的社交经验,因此我们的课程为您提供了与他人一起讨论的机会,帮助您做出新的发现并形成新的想法。
你can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

了解有关FutureLearn如何转化接受教育的更多信息