2.11 (Separating the Digits in an Integer) Write a script that inputs a five-digit integer from the user. Separate the number into its individual digits. Print them separated by three spaces each. python

Respuesta :

Answer:

The program in Python is as follows:

number = int(input())

myList = [int(num) for num in str(number)]

for i in myList:

   print(i,end="   ")

Explanation:

This gets input from the user

number = int(input())

This converts the number to a list (each digit of the number becomes the elements of the list)

myList = [int(num) for num in str(number)]

This iterates through the list

for i in myList:

This prints the list element followed by 3 blank spaces

   print(i,end="   ")