Python - Tuples

page 1 out of 3

page 1 out of 3


Question 1     

What is the output of the following code snippet?

aTuple = (100, 200, 300, 400, 500)
print(aTuple[-2])
print(aTuple[-4:-1])





Question 2     

Tuples are represented with?






Question 3     

What is the data type of (‘a’)?







Question 5     

What will be the output of below code snippet?

 


tupl=([2,3],"abc",0,9)
tupl[0][1]=1
print(tupl)





Question 6     

What will be the output of below code snippet?

 


t=(‘a’,’b’,’c’)
t1=t*2
print(len(t1))





Question 7     

What will be the output of the following code snippet?

a = ('check',)
n = 2
for i in range(int(n)):
    a = (a,)
    print(a)





Question 8     

Can tuples be keys of dictionaries?






Question 9     

What is the output of the following code?

 


a=("Hello") *3

print(a)





Question 10     

Find out the correct way to define a tuple with single element 50?





page 1 out of 3

page 1 out of 3


Sign Up Page

Oops!!

To view the solution need to Login



Score : 0 / 0
L
o
a
d
i
n
g
.
.
.