簡體   English   中英

如何將二進制字符串作為輸入並將其轉換為python中的列表?

[英]How to take binary string as an input and convert it to a list in python?

我想將二進制字符串作為輸入(01110111)並將輸入轉換為這樣的列表 [0,1,1,1,0,1,1,1] in Python。你能幫我怎么做嗎?

TIA!

使用list()將單詞拆分為字母列表。

input = "01110111"
list_of_letters = list(input)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM