for..in..遍历循环的简写模式
生活随笔
收集整理的這篇文章主要介紹了
for..in..遍历循环的简写模式
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
raw_words = [0,1,2,3,4,5]
words = [raw_word for raw_word in raw_words]
print(words)
a = {word: True for word in words}
print(a)
?
轉載于:https://www.cnblogs.com/plhc/p/9521785.html
總結
以上是生活随笔為你收集整理的for..in..遍历循环的简写模式的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Arduino使用HC05蓝牙模块与手机
- 下一篇: POJ 1287 Prim算法模板