码与计算机交流的过程就叫做交互。
多试一条指令!
>>> print 5 + 3
8
>>>
计算机非常擅长算术运算,计算机被创造出来的初期就是被用来数据计算。
再试一条指令!
>>> print 5 * 3
15
>>>
====== Mr.Lee TIPS ======
几乎所有计算机程序和语言中都使用 * 符号作为乘号。这个符号称作“星
号”或“星”。
======口算&计算器&python 三者进行对比吧======
口 算:Print 5 * 3
计算器:Print 98765431 - 9876543
======口算&计算器&python 三者进行对比吧======
利用 python 你除了可以超大数的数学计算之外,你还可以做些令人意想不
到的事情,例如:
>>> print “Dog” + “ brother”
Dog brother
>>
或者
>>> print “where is plane ” * 20
where is plane where is plane where is plane where is plane where is plane where
is plane where is plane where is plane where is plane where is plane where is plane
where is plane where is plane where is plane where is plane where is plane where is
plane where is plane where is plane where is plane
>>>
计算机除了非常擅长运算外,另一件事情就是反复的做事情,重要的是它不
会感到枯燥,就像上面我让计算机喊了 20 句 where is plane ,如果你高兴可以
让它喊到直到 MH370 出现,前提是马航要给力还有就是不要停电……
五、该编程了
到目前为止,我们只是看到单个 python 指令的演示,其实程序就是多个指
令的集合。
1、创建程序的方法:
a.通过 Python Shell 菜单栏 → File → New Windows 创建;
b.快捷键:Ctrl + N。
*新程序窗口标题栏显示“Untitled”(未命名)。如何给程序取名字?
2、程序 1 我们的第一个程序-“我爱吃香蕉”
print “我爱吃香蕉!”
print “香蕉 ” * 20
评论0
最新资源