鱼C论坛

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

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

    [复制链接]
发表于 2024-5-17 11:42:15 | 显示全部楼层
1
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2024-5-17 11:43:48 | 显示全部楼层
1
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2024-5-17 16:13:30 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

-------- 动动手 --------

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



请将第 1 题的代码写在下方:
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-5-17 16:57:07 | 显示全部楼层
111请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

-------- 动动手 --------

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



请将第 1 题的代码写在下方:
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-5-17 17:06:11 | 显示全部楼层
1
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2024-5-17 17:17:37 | 显示全部楼层
1
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2024-5-17 23:21:37 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:交互模式即使反馈;编辑器模式运行程序

第 1 题的答案是:int

第 2 题的答案是:功能一样

第 3 题的答案是:75

第 4 题的答案是:prtab会显示所有可能的命令供参考

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

-------- 动动手 --------

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



请将第 1 题的代码写在下方:temp = input("这次的数学成绩:")
guess = int(temp)
if guess == 100:
    print("好棒,你离女神又近了一步*^_^*")
else:
    print("小子,想要幸福,就得努力!")

print("游戏结束,不玩啦●◡●")
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-5-18 16:25:15 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:

第 1 题的答案是:
dir(__builtins__)
['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']
第 2 题的答案是:
不一样,Print()语法错误
第 3 题的答案是:
~
第 4 题的答案是:
用于补充变量名以及函数名
第 5 题的答案是:
修正:if guess ==8
-------- 动动手 --------

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



请将第 1 题的代码写在下方:
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-5-18 17:17:39 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

-------- 动动手 --------

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



请将第 1 题的代码写在下方:
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-5-18 17:38:06 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

-------- 动动手 --------

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

year = 1
second = year * 365 *24 *60 *60
second
31536000

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

使用道具 举报

发表于 2024-5-18 20:45:46 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:==

-------- 动动手 --------

请将第 0 题的代码写在下方:
time = 365 * 24 *3600
print(time)


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

使用道具 举报

发表于 2024-5-18 23:48:57 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:
- 交互模式:代码按步骤可即时看到结果,修改不方便
- 编辑器模式:代码全部写完,运行后才能看到结果,修改方便

第 1 题的答案是:
- dir()

第 2 题的答案是:
- 不一样,Python区分大小写

第 3 题的答案是:
- 具体内容如下
- ['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 ” 里面 “=” 是赋值,应该为 “==”

-------- 动动手 --------

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

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

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

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

使用道具 举报

发表于 2024-5-19 10:44:34 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

-------- 动动手 --------

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



请将第 1 题的代码写在下方:
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-5-19 10:51:38 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:

第 1 题的答案是:int

第 2 题的答案是:不一样

第 3 题的答案是:46

第 4 题的答案是:没有了

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

-------- 动动手 --------

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



请将第 1 题的代码写在下方:
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-5-19 14:53:11 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:交互模式是即时的,编辑模式是之后的

第 1 题的答案是:int

第 2 题的答案是:不一样

第 3 题的答案是:69

第 4 题的答案是:用于补全

第 5 题的答案是:guess被赋值为8而不是等于8

-------- 动动手 --------

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



请将第 1 题的代码写在下方:a = input('give me your number')
temp =int(a)
if temp == 100:
    print("you're good")
else:
    print('you need study hard')
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-5-19 16:32:20 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

-------- 动动手 --------

请将第 0 题的代码写在下方:
# 计算一年有多少秒
seconds_per_minute = 60
minutes_per_hour = 60
hours_per_day = 24
days_per_year = 365

seconds_per_year = seconds_per_minute * minutes_per_hour * hours_per_day * days_per_year
seconds_per_year


请将第 1 题的代码写在下方:while True:
    score = int(input("请输入此次数学考试成绩:"))
    if score != 100:
        print("小子,想要幸福,就得努力!")
        print("buwanla")
    else:
        print("好棒,你离女神又近了一步!")
        print("buwanla")
        break  # 添加break语句来终止循环
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-5-19 16:48:10 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------
写纸上了
第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

-------- 动动手 --------

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



请将第 1 题的代码写在下方:
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-5-19 21:13:38 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

-------- 动动手 --------

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



请将第 1 题的代码写在下方:
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-5-20 18:32:12 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

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

-------- 动动手 --------

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



请将第 1 题的代码写在下方:
score = input("请输入你的数学成绩:")
if score == 100:
    print("好棒,你离女神又近了一步^_^")
else:
    print("小子,想要幸福,就得努力!")
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-5-20 23:17:05 | 显示全部楼层
请回复您的答案^_^

-------- 问答题 --------

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

-------- 动动手 --------

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



请将第 1 题的代码写在下方:
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-26 12:28

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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