Python Forum

Full Version: producing numbers out of a list
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This sounds a little too much like a homework assignment, so will give you my suggested process but not the code.
1. Find the length of your list of digits = length
2. Make a list of 10^n where n is the range of 0 to length-1
3. Loop through the digits for each position, multiplying each digit by the place from step 2, shifting to next place when complete. This is the hard step.
4. Store each number generated by #3 in a list which you will then add the items, or multiply as someone else suggeted.
5. Voila.
Pages: 1 2