鱼C论坛

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

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

    [复制链接]
发表于 2021-6-27 15:58:55 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:IDLE交互模式是1问1答式的。无需input,直接输入函数名或数组名就可输出。而编辑器return不可直接打印,需要input来执行。可同时输入多个问题,多个回答。

第 1 题的答案是:int,var,dir ....

第 2 题的答案是:不一样。print是函数,Print是变量

第 3 题的答案是:72??

第 4 题的答案是:按3次tab可帮助联想内置函数?

第 5 题的答案是:最后一样没有缩进

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

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

365*24*60*60

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


temp = input("本次考试成绩: ")
marks = int(temp)

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

使用道具 举报

发表于 2021-6-27 16:55:33 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:
交互模式一次回答一个问题,编辑模式一次回答多个问题

第 1 题的答案是:
input()

第 2 题的答案是:
不一样

第 3 题的答案是:
python3.9.5有153个
第 4 题的答案是:
在编辑模式下按3可以自动查找函数
第 5 题的答案是:
if guess==8

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

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



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

使用道具 举报

发表于 2021-6-27 17:12:28 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:
交互模式是每按一次回车就执行一次,编辑器模式是要选择运行才会运行所有代码

第 1 题的答案是:
dir()
int()
第 2 题的答案是:
不一样,python很注重大小写,虽然不知道Print()功能是什么

第 3 题的答案是:
61个

第 4 题的答案是:
属实没有发现

第 5 题的答案是:
if 后为 ==

>>>>> 动动手 <<<<<
请将第 0 题的代码写在下方:
seconds=365*24*60*60
print(seconds)


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

使用道具 举报

发表于 2021-6-27 19:34:21 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

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

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



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

使用道具 举报

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

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

第 0 题的答案是:交互模式会及时反馈结果

第 1 题的答案是:dir

第 2 题的答案是:不一样,Print()语法错误

第 3 题的答案是:72

第 4 题的答案是:

第 5 题的答案是:guess = 8: 错误 不是赋值给变量应该是变量==的数值

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

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


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

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

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

使用道具 举报

发表于 2021-6-27 21:57:03 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

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

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



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

使用道具 举报

发表于 2021-6-27 22:04:29 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:交互模式实时反馈输入的代码
第 1 题的答案是:guess,if,else

第 2 题的答案是:Print()是字符串,print()是内置函数

第 3 题的答案是:ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning', 'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError', 'ConnectionRefusedError', 'ConnectionResetError', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Exception', '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', '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'这么多

第 4 题的答案是:代码规范

第 5 题的答案是:if guess ==  缺个=

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

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

60*60*24*365

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

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

if guess == 100:
    print("这次数学考试成绩:100")
    print("好棒!你离女神又近了一步")
else:
    print("这次数学考试成绩:temp")
    print("想要幸福就要努力!")

print("查询结束啦")
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-6-27 22:21:14 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:
IDLE 交互模式直接简单,不能像编辑器模式那样条理清晰

第 1 题的答案是:
int()

第 2 题的答案是:
Python 区分大小写 print()输出函数,Print()不能识别虽没报错,但部分功能失效。

第 3 题的答案是:
帮助列70多个内置函数,应该不止70多个。可能有上百个乃至几千个

第 4 题的答案是:
Tab除了缩进,还可以补全内置函数,不记得内置函数随便输入字母或数字按Tab就列出内置函数

第 5 题的答案是:
if guess = 8: #会报语法错误,判断变成了赋值

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

请将第 0 题的代码写在下方:
>>> 365*24*60*60
31536000
交互模式直接简单,但还是编辑器模式条理清晰,日后查看便知是做什么

#年天数
years_days_num = 365
#天小时数
days_hour_num = 24
#小时分数
hour_minute_num = 60
#分秒数
minute_seconds_num = 60
#一年有多少秒
how_seconds_years = 0

how_seconds_years = years_days_num * days_hour_num * hour_minute_num * minute_seconds_num

print("一年有多少秒:",how_seconds_years)

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

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

请老师批阅,指教
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-6-27 22:56:41 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:交互模式给指令,立刻得到反馈,通常是一条指令;编辑器模式可以编辑多条指令。

第 1 题的答案是:int

第 2 题的答案是:不一样

第 3 题的答案是:152

第 4 题的答案是:补全

第 5 题的答案是:8前有两个=

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

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


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

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

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

使用道具 举报

发表于 2021-6-28 00:18:45 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:

第 1 题的答案是:
temp = input("本次考试成绩")
guess = int(temp)

if guess <=60:
    print("小子,想要幸福,就得努力!")
if guess >=60:
    print("好棒,你离女神又近一步^_^")
print("游戏结束不玩啦^_^")

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

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

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



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

使用道具 举报

发表于 2021-6-28 03:04:37 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:IDLE交互模式可以直接运行,编辑器模式需要点击Run后再运行;

第 1 题的答案是:dir()、int()

第 2 题的答案是:不一样

第 3 题的答案是:153

第 4 题的答案是:用来补齐函数,比如我输入一个i,按下tab,就弹出i开头的选择框了

第 5 题的答案是:if guess == 8 (应该两个等号)

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

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


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

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

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

使用道具 举报

发表于 2021-6-28 10:55:13 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:交互模式是个对话框,编辑器是个shell

第 1 题的答案是:if else

第 2 题的答案是:不一样

第 3 题的答案是:81个

第 4 题的答案是:提示BIF完整字符串

第 5 题的答案是:if guess == 8:,少了一个=,一个=是赋值,两个才是等于的意思

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

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

31536000

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

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

使用道具 举报

发表于 2021-6-28 12:03:21 | 显示全部楼层
aa
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-6-28 14:37:02 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:0

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

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

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



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

使用道具 举报

发表于 2021-6-28 14:57:28 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

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

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



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

使用道具 举报

发表于 2021-6-28 15:00:59 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案 IDLE更加适合来练习而编辑器模式比较适合来演示一些简短的代码

第 1 题的答案是:import

第 2 题的答案是:不一样,首字母小写

第 3 题的答案是:??

第 4 题的答案是:??

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

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

请将第 0 题的代码写在下方:
a = 12*30*24*60*60
print('一年有多少秒:'+str(a))


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

使用道具 举报

发表于 2021-6-28 15:35:51 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:

第 1 题的答案是:int

第 2 题的答案是:不一样

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:可以

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

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

31536000

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

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

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

使用道具 举报

发表于 2021-6-28 16:11:44 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

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

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



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

使用道具 举报

发表于 2021-6-28 19:34:25 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:31536000

第 1 题的答案是:


第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

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

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


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

使用道具 举报

发表于 2021-6-28 21:33:21 | 显示全部楼层
请回复您的答案^_^

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

第 0 题的答案是:

第 1 题的答案是:

第 2 题的答案是:

第 3 题的答案是:

第 4 题的答案是:

第 5 题的答案是:

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

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



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

if guess ==100:
    print("加油,你离成功又进了一步")
else :
    print("继续努力哦")
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-30 04:28

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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