当前位置:网站首页>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)
边栏推荐
- Computer version wechat applet full screen display method, mobile phone horizontal screen method.
- 2.9 overview of databinding knowledge points
- lambda与匿名内部类的区别
- Kung Fu pays off, and learning is done
- 145. Post order traversal of binary tree
- 剑指Offer03. 数组中重复的数字【简单】
- Airflow installation jump pit
- 023 ([template] minimum spanning tree) (minimum spanning tree)
- Applet wxss introduction
- Summary of error prone knowledge points: Calculation of define s (x) 3*x*x+1.
猜你喜欢
剑指Offer04. 二维数组中的查找【中等】
Itext7 uses iexternalsignature container for signature and signature verification
Sword finger offer06 Print linked list from end to end
Sword finger offer09 Implementing queues with two stacks
(最新版) Wifi分销多开版+安装框架
2021 autumn Information Security Experiment 1 (password and hiding technology)
Sword finger offer03 Repeated numbers in the array [simple]
The future of cloud computing cloud native
公纵号发送提示信息(用户微服务--消息微服务)
低代码平台国际化多语言(i18n)技术方案
随机推荐
Nodejs+Express+MySQL实现登陆功能(含验证码)
使用BLoC 构建 Flutter的页面实例
flinksql是可以直接客户端建表读mysql或是kafka数据,但是怎么让它自动流转计算起来呢?
alright alright alright
Adult adult adult
225. Implement stack with queue
Record your vulnhub breakthrough record
242. Effective letter heteronyms
Develop plug-ins for idea
Summary of development issues
Adult adult adult
347. Top k high frequency elements
最新版抽奖盲盒运营版
(最新版) Wifi分销多开版+安装框架
Summary of error prone knowledge points: Calculation of define s (x) 3*x*x+1.
Kung Fu pays off, and learning is done
Prompt unread messages and quantity before opening chat group
Flutter Widget : KeyedSubtree
CNN MNIST handwriting recognition
Sword finger offer10- I. Fibonacci sequence