测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

PROBLEM SET

format方法

按知识点筛选题目,系统巩固该考点。

共 13 题
重置

题目列表

共 13 题
A57769 Python解释器中执行如下代码:'{2},{0},{1}'.format('You','need','Python')结果是?( ) 2023年-选择题 字符串格式化 format方法 索引 -- -- A58059 代码print('{}-{}*{}={}'.format(20,3,4,8))打印的结果是20-3*4=8。 2023年-判断题 字符串格式化 format方法 输出语句 -- -- A59206 format方法通常用来格式化print的 2021年 字符串格式化 format方法 变量传参 -- -- A58993 >>> '{0:%}'.format(3.5)返回'350.000000%'; >>>’{0:.2f}’.format(1/5)返回'0.2'。 2021年 字符串格式化 format方法 浮点数精度 -- -- A58868 运行下列代码,正确的结果是?( ) >>>print("{:06.2f}".format(3.1415926)) 2021年 字符串格式化 format方法 浮点数精度 -- -- A58854 >>> '{0:%}'.format(3.14)返回'3.140000%';>>>'{0:.2f}'.format(3.14)返回'3.14'。 2021年 字符串格式化 format方法 格式化说明符 -- -- A59626 下面程序的执行结果为?( ) s = '{0}+{1}={2}'.format(2, 3, 5) print(s) 2020年 字符串格式化 format方法 输出语句 -- -- A59585 >>>"{:06.2f}".format(3.2455) 运行结果为 2020年 字符串格式化 format方法 浮点数精度 -- -- A59551 在Python中,代码print('{:8}'.format(12))中数字8的作用是按8位字符宽度输出数字12。 2020年 输出格式 字符串格式化 format方法 -- -- A57160 Python中 print('八进制{0:o}'.format(71)) 正确的输出结果是?( ) 2023年-选择题 进制转换 字符串格式化 format方法 -- -- A60017 执行下列Python代码的结果是?( )>>> a = "3.1415926" 2024年-选择题 字符串格式化 format方法 精度控制 -- -- A59846 执行下列语句,得到的结果是?( )print('{0:.3f}'.format(0.333333333333)) 2024年-选择题 字符串格式化 format方法 浮点数精度 -- -- A60901 执行语句print("这{1}箱橙子的重量为{0}公斤。".format(5,3)),得到的输出结果是?( ) 2025年 字符串格式化 format方法 参数索引 -- --