Answer to Question #265984 in Python for Viswa

Question #265984

You are given a string containing ten digits, write a program to print these digits in a human readable format.



There are some rules to how to read a number,



1. Divide the ten digit number into set of four-three-three digits



2.use the following prefixes for consecutive digits



# Single numbers just read them seperately



# 2 successive numbers use double



# 3 successive numbers use triple



# 4 successive numbers use quadruple

1
Expert's answer
2021-11-15T00:23:16-0500
string = '0123456789'
print(string[:4], '-', string[4:7], '-', string[7:])

0123 - 456 - 789

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS