0 like 0 dislike
import random

num_list = random.sample(range(1, 101), 10)

print('原始的10個數字為:')

$1

num1 = num_list.copy()

num1.reverse()

print('\n\n反向的10個數字為:')

for i in num1:

    print(i, end = ' ')

print('\n\n最大的數:', max(num_list))

print('最小的數:', min(num_list))

print('\n總和:', sum(num_list))

print('平均:', sum(num_list) / len(num_list))

num1.sort(reverse = True)

print('數字從大到小排列:', end = '')

for i in num1:

    print(i, end = ' ')

num_list.insert(2, 100)

del num_list[-1]

print('\n修改後的串列:', end = '')

for i in num_list:

    print(i, end = ' ')
[Exercise] Fill in the blank - asked in 作業 by (937 points)
Available when: Unlimited - Due to: Unlimited
| 74 views
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.63.135
©2016-2020

No related questions found

10,746 questions
120,629 answers
112,784 comments
3,802 users