a to the power 2: the code is
for item in range(5):
print(item**2)
0
1
4
9
16
the operator is **
, for example, if we want a \times a \times a, we should write a**3
a to the power 2: the code is
for item in range(5):
print(item**2)
0
1
4
9
16
the operator is **
, for example, if we want a \times a \times a, we should write a**3
本文标题:Python notes
本文链接:https://www.haomeiwen.com/subject/setweftx.html
网友评论