Skip to main content

Posts

Showing posts from January, 2025

GRADE XI : TUPLES REVISION QUESTIONS

  TUPLES PRACTICE QUESTIONS 1.#  Find the output: tuple1 = (15, 25, 35, 45, 55, 65)  # Given tuple list1 = list(tuple1)  # Convert tuple to list new_list = [] for i in list1:     if i % 5 == 0:            new_list.append(i) new_tuple = tuple(new_list) print(new_tuple) 2.#Give Output of the following code: Tuple1 = (5,6,-1,3) Tuple2 = (7,8,4,-9) Tuple3=() i=0 while i<4:     if(Tuple1[i]–Tuple2[i])%2==0:         Tuple3+=(Tuple1[i] + 2 * Tuple2[i],)     else:         Tuple3+=(2*Tuple1[i] –Tuple2[i],)     i+=1 print(Tuple3) 3.#Give Output of the following code: t=(3.5,1.2,2.6,4.8) L=list(t) count=0 for x in L:     L[count]+=int(x)+count     count+=1 print(L) 4.#Give Output of the following code: t1=(3.5,8,"computer","SCIENCE",False) t2=() for c in t1:     if type(c) == int:         t2+=(3*c,)     elif...