Comments (6)
學號:B10309022
姓名:蕭羽汝
程式內容:
number = []
middle = 0
while True:
i = input("enter a number or enter to finssh:")
if i is not '':
number.append(int(i))
else:
break
lowest = min(number)
highest = max(number)
total = sum(number)
count = len(number)
mean = total / count
number.sort()
if len(number) / 2 == 0:
middle = (number[count / 2] + number[count / 2 + 1]) / 2
else:
middle = number[int(count / 2)]
print('numbers:', number)
print('count =', count, 'sum =', total, 'lowest =', lowest, 'highest =', highest, 'mean =', mean, 'middle =', middle)
from python.
B10309020 張書銘
number = []
count = 0
while True:
m = input("Key a number or Enter to exit:")
try:
m = int (m)
number.append (m)
count+= 1
except ValueError as err:
if m == "":
break
else:
print ("Please enter an integer.")
number.sort()
if count % 2 == 0 :
medium = (number[count // 2] + number[(count // 2 - 1)]) / 2
else :
medium = number [(count - 1 ) // 2]
print (number)
print ("sum=" , sum ( number) )
print ("count=",count)
print ("highest=", max ( number ) )
print ("lowest=", min ( number ) )
print ("mean=" , sum ( number) / count )
print ("medium=", medium)
from python.
B10309024 陳穎婷
numbers = []
sum = 0
count = 0
while True:
try:
n = 0
n = int(input("enter a number or Enter to finish:"))
numbers.append(n)
sum = sum + n
count = count + 1
except ValueError as err:
break
print("numbers: ",numbers)
numbers.sort()
middle = count // 2
if count % 2 == 0:
median = (numbers[middle-1] + numbers[middle]) / 2
else:
median = numbers[middle]
print("count = ", count, "sum = ", sum, "lowest = ", numbers[0], "highest = ", numbers[-1], "mean = ", sum / count, "median = ", median)
from python.
張美詩 B10309008
lists = []
times = 0
while True:
number = input("鍵入一個數字或按下Enter鍵完成:")
if number == "":
break
number = int(number)
lists.append(number)
times = times+1
lists.sort()
if times / 2 == 0 :
median = (lists[times / 2 - 1] + lists[times / 2]) /2
else :
median = lists[(times-1) // 2]
print("median:",median)
print("numbers:",lists)
print("count:",times)
print("sum:",sum(lists))
print("lowest:",min(lists))
print("higest:",max(lists))
print("mean:",sum(lists)/len(lists))
from python.
B10330331 陳語晏
#計算機+中位數
sumx = 0
all_x = []
all_num = []
while True:
x = input("輸入數字或Enter:")
if x is not "":
num = int(x)
sumx += num
all_x.append(num)
all_num.append(num)
else:
break
count = len(all_x)
all_x.sort()
if count%2 == 0:
middle_1 = int(count/2-1)
middle_2 = int(count/2)
middle = (all_x[middle_1] + all_x[middle_2])/2
else:
middle = all_x[int(count/2)]
print("數字:",all_num)
print("排序後:",all_x)
print("次數:",len(all_x))
print("加總:",sumx)
print("平均:",sumx/len(all_x))
print("最小值:",min(all_x))
print("最大值:",max(all_x))
print("中位數:",middle)
from python.
是你们用什么蟒蛇他妈的版本反正?
from python.
Related Issues (11)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python.