# 使用while循环计算1到10的和 total = 0 count = 1 while count <= 10: total += count count += 1 print(f"1到10的和是: {total}")