2331 views|0 replies

424

Posts

8

Resources
The OP
 

pyboardCN V2 plays with the transplantation of simple python algorithms [Copy link]

 
  1. [code]list = [3, 1, 5, 7, 8, 6, 2, 0, 4, 9] def choice(list): for i in range(0,len(list)): min_loc = i for j in range(i+1,len(list)): if list[min_loc]>list[j]: #Minimum value traversal comparison min_loc = j list[i],list[min_loc] = list[min_loc],list[i] return list choice(list)
复制代码
You can print the result directly in the terminal through choice, or you can use serial port and other communication methods to transmit it to the PC for display. I forgot to convert ASCII when outputting to the serial port


 
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list