Python Practice › List Programs › Program 42
Join numbers into one number
Write a Python program to convert a list of numbers into a single number.
Input
[12, 45, 56]
Output
124556
Approach
- Join their string forms and convert back to int.
Solution
numbers = [12, 45, 56]print(int("".join(map(str, numbers))))Output
124556
Learn the concept
New to this topic? Read the lesson, then come back.