Python Practice › List Programs › Program 42

Join numbers into one number

EasyList Programs · 42 of 100

Write a Python program to convert a list of numbers into a single number.

Advertisement
Input
[12, 45, 56]
Output
124556

Approach

  1. Join their string forms and convert back to int.

Solution

Python
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.

More list programs

← All 100 List Programs

Leave a Comment