AI题库 · Python编程五级题库
题目分享 #16008
小明正在编写一个程序,用于计算某个物品的重量(以千克为单位),向下取整到最接近的整数。以下是他的代码,如果输出结果为7,则横线上的代码应为?( )
import math weight = 7.8 floor_weight = ________ print(floor_weight)
A
math.ceil(weight)
B
math.upper(weight)
C
math.down(weight)
D
math.floor(weight)
AI题库 · 编程考级与信奥赛真题库
查看答案 →
复制链接后可在微信、QQ、小红书等平台粘贴分享;答案与解析在题目页。