鄂教版(2016)九上信息技术 10.石头剪刀布--Python逻辑运算 课件(16张PPT)

文档属性

名称 鄂教版(2016)九上信息技术 10.石头剪刀布--Python逻辑运算 课件(16张PPT)
格式 ppt
文件大小 3.7MB
资源类型 教案
版本资源 通用版
科目 信息技术(信息科技)
更新时间 2020-11-24 11:45:28

图片预览

文档简介

逻辑运算
湖北教育出版社九年级上册《信息技术》
让程序改变世界!Change the world by program!










让程序改变世界!Change the world by program!









让程序改变世界!Change the world by program!
真(True)
假(False)
与运算(and)
或运算(or)
非运算(not)



False
True
×

让程序改变世界!Change the world by program!
1、在Python中输入1<2,运行结果是:



True
False
×

让程序改变世界!Change the world by program!
2、在Python中>>>s1=True
>>>s2=False
>>>print (s1 and s2)
运行结果是:
让程序改变世界!Change the world by program!



False
True
×

3、在Python中>>>s1=True
>>>s2=False
>>>print (s1 or s2)
运行结果是:



False
True
×

让程序改变世界!Change the world by program!
4、在Python中>>>s1=True
>>>s2=False
>>>print (not s2)
运行结果是:
Guido van Rossum
吉多·范罗苏姆
让程序改变世界!Change the world by program!
让程序改变世界!Change the world by program!



1、在“石头剪刀布”游戏中,用逻辑运算得输赢结果。完成10.2 “石头剪刀布”手势表达式
电脑的“手势”
表示的数
我的“手势”
表示的数
赢 家
表达式


我胜
电脑==1 and 人==3

让程序改变世界!Change the world by program!














1、在编写程序时,会遇到各种逻辑运算,先说出下面各表达式的运算结果,再上机验证。
 表达式
not False,
not 0,
not 5,
True and(1 or 4),
True and (1<4)
 运算结果
 
表 达 式
True and ((not 1) or (1<4)) or ((4>5) and (2>3))
运算结果
True
True
False
1
True
True



2、试着把“我胜”的条件合在一起,并完成程序。
(computer==1 and man==3)or (computer==2 and man==1) or (computer==3 and man==2)
让程序改变世界!Change the world by program!
我胜









让程序改变世界!Change the world by program!









让程序改变世界!Change the world by program!
THANKS
同课章节目录