Monday, 24 January 2022

Write a Python program to convert a tuple of string values to a tuple of integer values

Slip 21 Q 2

CODE :


tup1=(('333','33'),('1416','55'))
a,b=tup1
newlista=[]
newlistb=[]
arr=[]
for i in a:
    newlista.append(int(i))
arr.append(newlista)
for i in b:
    newlistb.append(int(i))
arr.append(newlistb)
finaltup=tuple(map(tuple, arr))
print(finaltup)



OUTPUT:



No comments:

Post a Comment

Write a Java program to display given extension files from a specific directory on server machine.

 DOWNLOAD     SLIP14Q2 /** * STEPS TO RUN CODE * Step 01 compile the code * Step 02 run the code * Step 03 give a file directory locatio...