鱼C论坛

 找回密码
 立即注册
楼主: 小甲鱼

[课后作业] 第002讲:用Python设计第一个游戏 | 课后测试题及答案

    [复制链接]
发表于 2023-11-25 17:38:03 | 显示全部楼层
请回复您的答案^_^

>>>>> 问答题 <<<<<

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

>>>>> 动动手 <<<<<

请将第 0 题的代码写在下方:



请将第 1 题的代码写在下方:
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-25 19:59:03 | 显示全部楼层
请回复您的答案^_^

&gt;&gt;&gt;&gt;&gt; 问答题 &lt;&lt;&lt;&lt;&lt;

第 0 题的答案是:0.交互模式立马给相应,编辑器模式需保存运行

第 1 题的答案是:
Int()
第 2 题的答案是:
2.不一样,prin()是BIF内置函数,用于打印字符串,Print()是自定义函数,可自主设定函数功能
第 3 题的答案是:
不知道
第 4 题的答案是:
4.打开内置函数列表
第 5 题的答案是:
5.Guess=8是赋值,应该用==
&gt;&gt;&gt;&gt;&gt; 动动手 &lt;&lt;&lt;&lt;&lt;

请将第 0 题的代码写在下方:
365*24*60*60


请将第 1 题的代码写在下方:
score = input("这次数学考试成绩:")
answer = int(score)

if answer == 100:
    print("好棒,你离女神又近了一步^_^")
else:
    print("小子,想要幸福,就得努力!")

print("游戏结束不玩了《》")
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-25 20:04:57 | 显示全部楼层
请回复您的答案^_^

>>>>> 问答题 <<<<<

第 0 题的答案是:1.文本编辑模式,return不可直接打印,必须由print来执行。 2.交互模式,最重要的是无需print,直接输入函数名、数组名就可打印;再一个,交互模式不可用于函数的交互,只能进行像hello world的打印,以及数组的打印

第 1 题的答案是:int


第 2 题的答案是:不一样

第 3 题的答案是:68

第 4 题的答案是:
换行
第 5 题的答案是:不对称

>>>>> 动动手 <<<<<

请将第 0 题的代码写在下方:



请将第 1 题的代码写在下方:
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-25 20:28:26 | 显示全部楼层
请回复您的答案^_^

>>>>> 问答题 <<<<<

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

>>>>> 动动手 <<<<<

请将第 0 题的代码写在下方:



请将第 1 题的代码写在下方:
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-25 21:09:59 | 显示全部楼层
请回复您的答案^_^

>>>>> 问答题 <<<<<

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:guess == 8

>>>>> 动动手 <<<<<

请将第 0 题的代码写在下方:



请将第 1 题的代码写在下方:
""" 用Python设计第一个游戏 """

temp = input("请输入你这次数学考试的成绩:")
guess = int(temp)

if guess == 100:
    print("好棒,你离女神又近了一步^_^")
else:
    print("小子,想要幸福,就得努力!")
print("游戏结束,不玩啦^_^")
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-25 22:03:42 | 显示全部楼层
请回复您的答案^_^

>>>>> 问答题 <<<<<

第 0 题的答案是:交互式即刻给出答案,编辑器模式能复杂编辑

第 1 题的答案是:int

第 2 题的答案是:不一样

第 3 题的答案是:68

第 4 题的答案是:制表符

第 5 题的答案是:等于号错误应该用双等号

>>>>> 动动手 <<<<<

请将第 0 题的代码写在下方:
365*24*60*60


请将第 1 题的代码写在下方:
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-26 13:31:56 | 显示全部楼层
请回复您的答案^_^

>>>>> 问答题 <<<<<

第 0 题的答案是:
交互模式是一行一行执行代码,编辑器模式是运行整个编辑的代码
第 1 题的答案是:
max(),min(),sum()
第 2 题的答案是:
不一样
第 3 题的答案是:

第 4 题的答案是:
可以在输入代码时辅助补全代码
第 5 题的答案是:
if 判断语句中判断两个值是否相等,要用双=
>>>>> 动动手 <<<<<

请将第 0 题的代码写在下方:
>>> x = 365*24*60*60
>>> x
31536000


请将第 1 题的代码写在下方:
score = int(input("这次数学考试成绩:"))
if score == 100:
    print("好棒,你离女神又近了一步^_^")
else:
    print("小子想要幸福,就得努力!")
print("游戏结束不玩了^_^")
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-26 15:04:25 | 显示全部楼层
请回复您的答案^_^

>>>>> 问答题 <<<<<

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

>>>>> 动动手 <<<<<

请将第 0 题的代码写在下方:



请将第 1 题的代码写在下方:
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-26 15:38:46 | 显示全部楼层
请回复您的答案^_^

>>>>> 问答题 <<<<<

第 0 题的答案是:交互模式是呈现结果,编辑器只能编辑

第 1 题的答案是:temp函数

第 2 题的答案是:不一样

第 3 题的答案是:好多

第 4 题的答案是:没发现

第 5 题的答案是:if guess 后面应该是==

>>>>> 动动手 <<<<<

请将第 0 题的代码写在下方:
365 * 24 * 60 * 60


请将第 1 题的代码写在下方:
temp = input("这次数学考试成绩:")
guess = int(temp)

if guess == 100:
    print("好棒,你离女神又近了一步^_^ ")
    print("游戏结束,不玩啦^_^ ")
else:
    print("小子,想要幸福,就得努力!")
    print("游戏结束,不玩啦^_^ ")
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-26 15:39:47 | 显示全部楼层
请回复您的答案^_^

&gt;&gt;&gt;&gt;&gt; 问答题 &lt;&lt;&lt;&lt;&lt;

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

&gt;&gt;&gt;&gt;&gt; 动动手 &lt;&lt;&lt;&lt;&lt;

请将第 0 题的代码写在下方:



请将第 1 题的代码写在下方:
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-26 18:38:39 | 显示全部楼层
请回复您的答案^_^

>>>>> 问答题 <<<<<

第 0 题的答案是:答:交互模式一次只能执行一条指令,编辑器模式一次可以执行多条指令的组合。

第 1 题的答案是:答:还有:if……else……、int()、float()、str()等。

第 2 题的答案是:答:不一样。print()是python的内置函数,Print()在未定义未函数之前无法使用。

第 3 题的答案是:答:Python一共有158个内置参数,分别是:
ArithmeticError ;AssertionError ;AttributeError ;BaseException ;BaseExceptionGroup ;BlockingIOError ;BrokenPipeError ;BufferError ;BytesWarning ;ChildProcessError ;ConnectionAbortedError ;ConnectionError ;ConnectionRefusedError ;ConnectionResetError ;DeprecationWarning ;EOFError ;Ellipsis ;EncodingWarning ;EnvironmentError ;Exception ;ExceptionGroup ;False ;FileExistsError ;FileNotFoundError ;FloatingPointError ;FutureWarning ;GeneratorExit ;IOError ;ImportError ;ImportWarning ;IndentationError ;IndexError ;InterruptedError ;IsADirectoryError ;KeyError ;KeyboardInterrupt ;LookupError ;MemoryError ;ModuleNotFoundError ;NameError ;None ;NotADirectoryError ;NotImplemented ;NotImplementedError ;OSError ;OverflowError ;PendingDeprecationWarning ;PermissionError ;ProcessLookupError ;RecursionError ;ReferenceError ;ResourceWarning ;RuntimeError ;RuntimeWarning ;StopAsyncIteration ;StopIteration ;SyntaxError ;SyntaxWarning ;SystemError ;SystemExit ;TabError ;TimeoutError ;True ;TypeError ;UnboundLocalError ;UnicodeDecodeError ;UnicodeEncodeError ;UnicodeError ;UnicodeTranslateError ;UnicodeWarning ;UserWarning ;ValueError ;Warning ;WindowsError ;ZeroDivisionError ;_ ;__build_class__ ;__debug__ ;__doc__ ;__import__ ;__loader__ ;__name__ ;__package__ ;__spec__ ;abs ;aiter ;all ;anext ;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 。

第 4 题的答案是:

第 5 题的答案是:答:因为“if guess = 8:”中,判断是否相等应为“==”,而不是用于赋值的“=”,用于赋值的“=”,无法返回对ture或false

>>>>> 动动手 <<<<<

请将第 0 题的代码写在下方:



请将第 1 题的代码写在下方:temp = input("这次数学考试成绩:")
score = int(temp)

if score == 100:
    print("好棒,你离女神又近了一步^_^")
elif score >=0 and score <= 100:
    print("小子,想要幸福,就得努力!")
else:
    print("请输入正确的成绩分数!")

print("游戏结束,不玩啦^_^")
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-26 20:38:27 | 显示全部楼层
请回复您的答案^_^

>>>>> 问答题 <<<<<

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

>>>>> 动动手 <<<<<

请将第 0 题的代码写在下方:



请将第 1 题的代码写在下方:
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-27 10:54:40 | 显示全部楼层
请回复您的答案^_^

>>>>> 问答题 <<<<<

第 0 题的答案是:
交互模式:你输入一个命令,IDLE立刻执行并回复命令执行的结果;
编辑器模式:在IDLE新建一个命令窗口,进入编辑器模式,可以输入一大串python代码后,保存,保存后可在此模式下执行这个代码模块,执行结果会显示在IDLE交互模式的界面处。
第 1 题的答案是:
可以使用dir(__builtins__)命令查看所有python的BIF内置函数;
课上敲过的代码中还有int是内置函数;
有简单的方法就是与print和input颜色一样的就是相同的内置函数;
第 2 题的答案是:
不一样,python的命令大小写敏感。Print不能执行输出命令。
第 3 题的答案是:
执行len(dir(__builtins__))命令,可获得数组长度,共计159个。
第 4 题的答案是:
在交互模式中,Tab键还可用于命令提示。
第 5 题的答案是:
第6行,if guess == 8:  数字判断应该是==。
>>>>> 动动手 <<<<<

请将第 0 题的代码写在下方:
1 * 365 * 24 * 60 * 60
31536000


请将第 1 题的代码写在下方:
"""用pyhon课后作业"""

temp = input("这次数学考试成绩:")
guess = int(temp)

if guess == 100:
    print("好棒,你离女神又近一步^_^")
else:
    print("小子,想要幸福,就得努力!")
print("游戏结束,不玩啦^_^")
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-27 14:26:15 | 显示全部楼层
1
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2023-11-27 14:39:44 | 显示全部楼层
请回复您的答案^_^

>>>>> 问答题 <<<<<

第 0 题的答案是:一年有 31536000 秒

第 1 题的答案是:
temp = input("这次数学考试成绩:")
chengji = int(temp)
if chengji == 100:
    print("好棒,你离女神又近了一步^_^")
else:
    print("小子,想要幸福,就得努力!")


第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

>>>>> 动动手 <<<<<

请将第 0 题的代码写在下方:



请将第 1 题的代码写在下方:
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-27 14:47:00 | 显示全部楼层
1
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2023-11-27 14:53:48 | 显示全部楼层
1
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2023-11-27 14:57:50 | 显示全部楼层
1
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2023-11-27 15:11:51 | 显示全部楼层
1
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2023-11-27 15:13:18 | 显示全部楼层
1
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-5-14 01:35

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表