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 (939 points)
Available when: Unlimited - Due to: Unlimited
| 5 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.68.65.252
©2016-2019

No related questions found

8,391 questions
65,920 answers
40,347 comments
1,516 users