1. Home
  2. Docs
  3. Exercises
  4. Tuples Exercises

Tuples Exercises

Tuples Exercises

 

In this section Tuple Exercises are given.

Try these on your own.   Check out the solutions.
 

 

Exercise 1: print the number in words

Ex: 1234 => One Two Three Four
 
solution:
 


#print the number in words

num = 8976543201

a=("Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine")

for digit in str(num):

    print(a[int(digit)], end=" ")