当前位置:网站首页>Define a list, store n integers, and calculate the length, maximum value, minimum value and average value of the list
Define a list, store n integers, and calculate the length, maximum value, minimum value and average value of the list
2022-07-03 12:38:00 【iWillook】
#
# main.py
# List Handling
#
# Created by Mewlan Musajan on 4/29/21.
#
def listHandling(g):
listLength = 0
all = 0
maximum = max(g)
minimum = min(g)
for b in g:
listLength += 1
all += b
average = all / listLength
print(str(" The length of the list {0}, Maximum {1}, minimum value {2}, Average {3}").format(listLength, maximum, minimum, average))
list = [1, 2, 3, 4, 5, 6, 7, 8]
listHandling(list)
边栏推荐
猜你喜欢

Prompt unread messages and quantity before opening chat group

公纵号发送提示信息(用户微服务--消息微服务)

LeetCode 0556.下一个更大元素 III - 4步讲完

idea将web项目打包成war包并部署到服务器上运行

Sword finger offer07 Rebuild binary tree

剑指Offer09. 用两个栈实现队列

1-2 project technology selection and structure

记录自己vulnhub闯关记录

【ArcGIS自定义脚本工具】矢量文件生成扩大矩形面要素

Eureka self protection
随机推荐
The latest version of blind box mall thinkphp+uniapp
JVM内存模型
LeetCode 0556. Next bigger element III - end of step 4
Dart: self study system
(最新版) Wifi分销多开版+安装框架
Apache Mina开发手册
Official website of Unicode query
Idea packages the web project into a war package and deploys it to the server to run
Solve the problem of VI opening files with ^m at the end
Pki/ca and digital certificate
How to deploy web pages to Alibaba cloud
十条职场规则
Swift return type is a function of function
Write a simple nodejs script
Oh my Zsh + TMUX installation
RedHat5 安装Socket5代理服务器
Atomic atomic operation
Sqoop1.4.4原生增量导入特性探秘
Sword finger offer06 Print linked list from end to end
Nodejs+Express+MySQL实现登陆功能(含验证码)