Python-Quizzes | Python List Quiz | Question 22

Last Updated :
Discuss
Comments

Find the output of the following program: 

Python
li = [1, 1.33, 'GFG', 0, 'NO', None, 'G', True] 
val1, val2 = 0,'' 
for x in li: 
	if(type(x) == int or type(x) == float): 
		val1 += x 
	elif(type(x) == str): 
		val2 += x 
	else: 
		break
print(val1, val2) 

2 GFGNO

2.33 GFGNOG

2.33 GFGNONoneGTrue

2.33 GFGNO

Share your thoughts in the comments