安全问答

安全问答是一个知识全球问答,包含丰富的问答知识

首页 常规 游戏 娱乐 科技 程序员

用python 循环接收用户输入的10个整数变量n计算这10个数的平均值并输出要求用for循环结构完成循环变量i。sum=0

  • 日期: 2028-08-21
  • 标签: 时尚

count=0 for i in range(10): n = int(input("请输入第{}个整数:".format(i+1))) sum += n count += 1 average = sum/count print("这10个数的平均值:", average)

用python 循环接收用户输入的10个整数变量n计算这10个数的平均值并输出要求用for循环结构完成循环变量i。sum=0

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

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

  • 上一篇: Employee实体类这个改了但是剩下的这两个该怎么办 public LocalDateTime getEmpBirthday int birthYear = LocalDateTimenowgetYear - thisempAge; int birthMonth = int Mathrandom 12 + 1; int birthDay = i
  • 下一篇: fix the following java mongodb-driver-reactivestreams codeAggregatesgroupnew Documenttimestamp $timestampappendurl $url firstbreadcrumbObjectdatatoaspath Aggregatesgr

© 2019 • 2025 - 安全问答 站长邮箱:wxgpt@qq.com    ICP备案/许可证号:豫ICP备2024104334号-2