I want to give the user input pattern as
input1: 00,01,10,11
and another input as
input2: 0.1,0.2,0.24,0.5
and these inputs I am giving alternate value as one by one from these two inputs. For giving user input I am using:
input = int(raw_input())
.
But my desired output should be in separate 2-d array as [[0,0],[0,1],[1,0],[1,1]]
and [[0.1],[0.2],[0.24],[0.5]]
please give me good idea for this.
Take the 2-minute tour
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
|
|||
add comment |
You can use
and
Your first example (binary strings to lists of integers) will require a custom function for
Note that in Python 3.x |
|||||||||||||||||||||
|
0.11
become[0.1, 1]
or[0.11]
, for example? Should111
be[1, 1, 1]
,[11, 1]
, or[1, 11]
? Should the values in the inner lists be integers, strings, floats...? Look intostr.split
. – jonrsharpe Mar 4 at 14:12