当我们想求正方形三边形圆等的are时,我们如何在cm的基础上加一个平方分米千米的符号[重复]。

问题描述 投票:1回答:1
# lets calculate the area of a rectangle
length_of_rectangle_1 = 6
breadth_of_rectangle_1 = 10
area_of_rectangle_1 = length_of_rectangle_1 * breadth_of_rectangle_1
print(area_of_rectangle_1)
length_of_rectangle_2 = 12
breadth_of_rectangle_2 = 22
area_of_rectangle_2 = length_of_rectangle_2 * breadth_of_rectangle_2
print(area_of_rectangle_2)

我想找到如何把小2的顶部厘米

python python-3.x area
1个回答
1
投票

在Python中,你可以简单地将Unicode字符添加到字符串中。

str(100) + 'cm' + '\u00B2'

网络上有很多unicode字符表。 在Python中,你可以简单地将Unicode字符添加到字符串中:网络上有许多Unicode字符表,其中的 \u 部分意味着 "这是一个Unicode字符串",'00B2'部分只是符号的十六进制代码。 现在,这个字符在字体中是非常普遍的支持,但并不是所有的字体,甚至是那些声称支持Unicode的字体,都有所有的字符。 希望这能帮到你

© www.soinside.com 2019 - 2024. All rights reserved.