scratch与pythonc++的不同,你了解吗?

scratch与pythonc++的不同
一直有妈妈们问我,编程的各种学习有什么不同,每个年龄应该从什么开始
今天我来给大家分享一下scratch与pythonc++的不同。

首先,我先给大家看看scratch的编程界面截图
大家是不是觉得很容易理解?
你没有学过编程,但是你看到每个模块就知道他的意思了,你不需要去记每个模块的具体语句,具体格式,只需要看到合适的拖拽就可以了。
比如说我刚才随手编了一个水仙花数的程序,程序的题目是这样的。
所谓"水仙花数"是指一个三位数,其各位数字立方和等于该数本身。例如:153是一个"水仙花数",因为153=1的三次方+5的三次方+3的三次方。
那么这道题是个很经典的程序题目,他的思路就是三位数的范围是100-999,我们只需要从100开始挨个判断直到999,看是否符合水仙花数的条件就可以了。
我们先来看scratch的程序
大家觉得如何?
是不是虽然你编程可能是外行,但是看这个程序一目了然,完全可以读得懂编程者的思路。
运行起来也是格外的简单,直接点绿旗就好了。
我们来看下运行结果


python
。
那相同的题目,python是怎样的呢?
大家看出来区别了吗?python的程序看起来是不是更简单?但是他需要去记住各种语句和格式。
这个程序输出是这样的
我把程序随便改一下
这个程序大家看出来区别了吗?
可是他报错了
为什么呢?很简单,print前面忘记空格了。


输入小标题3
那么C++在格式上要求的更加严格,我们再来看看C++的同款程序
最后运行结果是
可以看出来,C++跟python语句非常相似,但是他的格式要求更高。比如所有的分号都不能忘记,一旦格式有一丁点不对就直接报错。

通过以上分析我想大家也知道了三者的区别。
这就是为什么作为一个专业的编程教师,我推荐一切刚入门的孩子,无论年龄大小都要从scratch开始。因为scratch可以忽略具体的语言,让孩子刚开始的时候建立一个具体的编程思维。

--end--
声明:本文章由网友投稿作为教育分享用途,如有侵权原作者可通过邮件及时和我们联系删除:freemanzk@qq.com