Python 2.7: Any way to return ALL possible combinations of numbers 0-9 for a certain number of digits? : <p>For example: say I wanted all possible combinations of 0-2 up to 3 digits the code would return the following:</p>

<p>0</p>

<p>1</p>

<p>2</p>

<p>00</p>

<p>01</p>

<p>02</p>

<p>10</p>

<p>11</p>

<p>12</p>

<p>20</p>

<p>21</p>

<p>22</p>

<p>000</p>

<p>001</p>

<p>002</p>

<p>010</p>

<p>020</p>

<p>011</p>

<p>022</p>

<p>012</p>

<p>021</p>

<p>100</p>

<p>101</p>

<p>102</p>

<p>110</p>

<p>111</p>

<p>112</p>

<p>120</p>

<p>121</p>

<p>122</p>

<p>200</p>

<p>201</p>

<p>202</p>

<p>210</p>

<p>220</p>

<p>211</p>

<p>221</p>

<p>212</p>

<p>222</p>
