What is the output of the following program?
Python
tup = ( 1 , 2 , 3 , 4 )
tup . append ( ( 5 , 6 , 7 ) )
print ( len ( tup ))
What is the output of the following program?
Python
tup = {}
tup [( 1 , 2 , 4 )] = 8
tup [( 4 , 2 , 1 )] = 10
tup [( 1 , 2 )] = 12
sum1 = 0
for k in tup :
sum1 += tup [ k ]
print ( len ( tup ) + sum1 )
What is the output of the following program?
Python
tup1 = ( 1 , 2 , 4 , 3 )
tup2 = ( 1 , 2 , 3 , 4 )
print ( tup1 < tup2 )
What is the output of the following program?
Python
tup = ( 1 , 2 , 3 )
print ( 2 * tup )
What is the output of the following program?
Python
tup = ( "Check" ) * 3
print ( tup )
What is the output of the following program?
Python
s = 'geeks'
a , b , c , d , e = s
b = c = '*'
s = ( a , b , c , d , e )
print ( s )
(‘g’, ‘*’, ‘*’, ‘k’, ‘s’)
(‘g’, ‘e’, ‘e’, ‘k’, ‘s’)
What is the output of the following program?
Python
tup = ( 2e-04 , True , False , 8 , 1.001 , True )
val = 0
for x in tup :
val += int ( x )
print ( val )
What is the output of the following program?
Python
li = [ 3 , 1 , 2 , 4 ]
tup = ( 'A' , 'b' , 'c' , 'd' )
li . sort ()
counter = 0
for x in tp :
li [ counter ] += int ( x )
counter += 1
break
print ( li )
What is the output of the following program?
Python
li = [ 2e-04 , 'a' , False , 87 ]
tup = ( 6.22 , 'boy' , True , 554 )
for i in range ( len ( li )):
if li [ i ]:
li [ i ] = li [ i ] + tup [ i ]
else :
tup [ i ] = li [ i ] + li [ i ]
break
[6.222e-04, ‘aboy’, True, 641]
[6.2202, ‘aboy’, False, 87]
What is the output of the following program?
Python
import sys
tup = tuple ()
print ( sys . getsizeof ( tup ), end = " " )
tup = ( 1 , 2 )
print ( sys . getsizeof ( tup ), end = " " )
tup = ( 1 , 3 , ( 4 , 5 ))
print ( sys . getsizeof ( tup ), end = " " )
tup = ( 1 , 2 , 3 , 4 , 5 , [ 3 , 4 ], 'p' , '8' , 9.777 , ( 1 , 3 ))
print ( sys . getsizeof ( tup ))
"This course is very well structured and easy to learn. Anyone with zero experience of data science, python or ML can learn from this. This course makes things so easy that anybody can learn on their own. It's helping me a lot. Thanks for creating such a great course."- Ayushi Jain | Placed at Microsoft Now's your chance to unlock high-earning job opportunities as a Data Scientist ! Join our Complete Machine Learning & Data Science Program and get a 360-degree learning experience mentored by industry experts. Get hands on practice with 40+ Industry Projects, regular doubt solving sessions , and much more. Register for the Program today!
There are 11 questions to complete.
Take a part in the ongoing discussion View All Discussion