假定number=4,下面哪个语句不会出错?


假定number=4,下面哪个语句不会出错?

A.print(format(number,"2d"),format(number**1.5,"4d"))

B.print(format(number,"2d"),format(number**1.5,"4.2d"))

C.print(format(number,"2d"),format(number**1.5,"4.2f"))

D.print(format(number,"2f"),format(number**1.5,"4.2d"))

正确答案:print(format(number,"2d"),format(number**1.5,"4.2f"))


Tag:python语言程序设计 假定 语句 时间:2022-01-17 20:23:38