|
答案:
一、测试题
0、什么是BIF?
BIF就是python的内置函数,帮助更快的执行python这种代码语言所下达的命令
1、用课堂上小甲鱼教的方法数一数python一共提供了多少个BIF?
下面这些全部都是:
'__build_class__', '__debug__', '__doc__', '__import__', '__loader__', '__name__', '__package__', '__spec__', 'abs', 'all', 'any', 'ascii', 'bin', 'bool', 'breakpoint', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'compile', 'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip']
2、在python看来:‘FISHC’和‘fishc’一样么?
不一样的,在Python中是严格区分大小写的,大写和小写含义不同;
3、在小甲鱼看来Python中什么最重要,你赞同么?
在小甲鱼看来python中最重要的就是缩进,控制好缩进才能保证语句正确;
4、这节课列子出现了“=”和“==”,他们表示不同的含义,你在编程中会不小心把“==”误写成“=”么?有没有好的办法可以解决这个问题呢?
在Python中“=“表示赋值,将右边的数据赋值给左边
“==”表示判断,用于if条件语句中
我认为最好的方法就是记住“==”只有用于判断的时候才用
5、你听过拼接这个词么?
听说过,formart表示拼接,链接两个字符串的词;
二、动动手
0、编写程序:hello.py,要求用户输入姓名并打印“你好,姓名!”
![Python 3.3.2 (v3.3.2:de47928ae3+6, may 16 2e13, [msc v.16ee 32 bit (In
tel)] on win32
Type "copyright", "credits" or "license()" for more information.
RESTART](file:///C:/Users/风凌渡/AppData/Local/Temp/msohtmlclip1/01/clip_image001.png)
temp=input("请输入你的姓名:")
guess=temp
ifguess=="费俊强":
print("你好,费俊强")
else:
print("错误")
print("结束")
1、编写程序:calc.py 要求用户输入1到100之间的数字并判断,输入符合要求打印“你妹好漂亮”,不符合要求则打印“你大爷好丑”
![Python 3.3.2 (v3.3.2:de47928ae3+6, may 16 2e13, [msc v.16ee 32 bit (In
tel)] on win32
Type "copyright" ,
"credits" or "license()" for more information.
: 88
: 188
RESTART
RESTART](file:///C:/Users/风凌渡/AppData/Local/Temp/msohtmlclip1/01/clip_image002.png)
temp=input("请输入1到100之间的数字:")
guess=int(temp)
if1<=guess<=100:
print("你妹好漂亮")
else:
print("你大爷好丑")
小黑屋|手机版|Archiver|鱼C工作室
( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)
GMT+8, 2026-4-1 18:47
Powered by Discuz! X3.4
© 2001-2023 Discuz! Team.