Python addition, subtraction, multiplication and division and the use of variables

Directly paste the code snippet, the details will be added later

#python进行加减乘除
print(0.1+0.2)
print(0.1+0.2-0.3*0.4/0.5)
print(1/3)
print(1*0.3)

#变量的使用
长 = 10
宽 = 5
高 = 2
底面积 = 长 * 宽
体积 = 底面积 * 高

print("底面积:",底面积)
print("体积:",体积)


i = 0
while i < 10:
    print('现在是第{}次循环'.format(i))
    i += 1 #千万不要忘记这一行,否则循环就停不下来了

 

Published 163 original articles · Liked 183 · Visit 120,000+

Guess you like

Origin blog.csdn.net/qq_31339221/article/details/98673605