40923228 cp2020

  • Home
    • Site Map
    • reveal
    • blog
  • HomePage
  • Webside
  • HW1
    • PCH6-RAM Basics
      • Memory Modules
      • Classifying Memory
      • Determining Type of Memory Based on Motherboard
      • History of RAM
      • Parity
      • Installing Memory Modules
      • Introduction to BIOS, CMOS, and Firmware
      • Configuring the System BIOS
    • PCH 7-Expansion Cards, Audio, Video, and Storage
      • AGP Slots
      • Processors
      • Video Displays and Video Cards
      • Install and Configure Expansion Cards
      • Storage Devices-Overview
      • Storage Devices-Hard Disk Drives
      • Storage Devices-Drive Interfaces
      • Storage Devices-Hot Swapping
  • HW2
    • 2-1(分組數列)
    • 2-2
    • 2-3
  • HW3
    • EX.10
    • EX.20
    • EX.32
  • 心得
HW2 << Previous Next >> 2-2

2-1(分組數列)

from random import shuffle #random(亂數) #shuffle
list = [40523138, 40523148, 40723217, 40728238, 40823148, 40823152, 40923201, 40923202, 40923203, 40923204, 40923205, 40923206, 40923207, 40923208, 40923209, 40923210, 40923211, 40923212, 40923213, 40923214, 40923216, 40923217, 40923218, 40923219, 40923220, 40923221, 40923223, 40923224, 40923225, 40923226, 40923227, 40923228, 40923229, 40923230, 40923231, 40923232, 40923233, 40923234, 40923235, 40923236, 40923237, 40923238, 40923239, 40923240, 40923241, 40923242, 40923243, 40923244, 40923245, 40923246, 40923247, 40923248, 40923249, 40923250, 40923251, 40923252, 40923253]
shuffle(list)
n = 5
m = int(len(list)/n)
list2 = []
for i in range(0, len(list),m):
    list2.append(list[i:i+m])
print(list2)

HW2 << Previous Next >> 2-2

Copyright © All rights reserved | This template is made with by Colorlib