莊俊祥LIST清單DICT字典RANDOM模組


#註解莊俊祥學過python
import random
x = [ i for i in range(10)]
print('產生清單',x)
y ={}
for i in x:
   y[i]=random.random()
print(y)
for i in y:
   print(i, y[i])

留言

  1. https://o3og413.blogspot.com/2025/06/blog-post.html
    https://o3og413.blogspot.com/2025/06/listdictrandom.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

馬可維茲風險平均數平面

程式碼註解

馬可維茲風險平均數平面