# This program calculates the area of a rectangle

length = 5
width = 3

area = length * width

print("The area of the rectangle is:", area)
# This program calculates the area of a circle

radius = 4

area = 3.14159 * radius ** 2

print("The area of the circle is:", area)
# This program calculates the sum of the first 100 natural numbers

sum = 0

for i in range(1, 101):
    sum += i

print("The sum of the first 100 natural numbers is:", sum)
请将上述例子进行代码格式化后再展示

原文地址: http://www.cveoy.top/t/topic/cy2 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录