Damien Rice
Damien Rice

Reputation: 101

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

I want to take a binary string as an input (01110111) and convert the input to a list like this [0,1,1,1,0,1,1,1] in Python. Can you help me how to do it?

TIA!

Upvotes: 1

Views: 382

Answers (1)

Frank Hetmyer
Frank Hetmyer

Reputation: 23

Use list() to split a word into a list of letters.

input = "01110111"
list_of_letters = list(input)

Upvotes: 2

Related Questions