Question -
Answer -
t=tuple( )
n=input(” Enter number of values:”)
for i in range(n):
a=input(“enter elements”)
t=t+(a,)
t1=t2=tuple( )
for i in t:
if i%2 == 0:
t2= t2 + (i,)
else:
tl=tl+(i,)
print “First Tuple”
print t1
print “Second Tuple”
print t2
Output:
Enter number of values: 10
enter elements 1
enter elements 9
enter elements 8
enter elements 5
enter elements 2
enter elements 3
enter elements 6
enter elements 4
enter elements 7
enter elements 10
First Tuple (1, 9, 5, 3, 7)
Second Tuple (8,2,6,4,10)