[Type A] Python Revision Tour-1 – Chapter 1
Table of Contents
20. Below are seven segments of code. Indicate the data type of each colored part.
- if temp < 32 :
bool
- L = [ ‘Hiya’, ‘Zoya’, Preet’ ] print(L[1])
str
- M = [ ] for i in range (3) : M. append (i) print(M)
list of int
- L = [ ‘Hiya’, ‘Zoya’, ‘Preet’ ] n = len (L) if ‘Donald’ in L[1: n] : print (L)
str
- if n% 2 == 0 : print(“Freezing”)
bool
- L = inputline.split() while L != ( ) : print (L) L = L[1:]
list of str
- L= [ ‘Hiya’, Zoya’, ‘Preet’ ] print (L[0] + L[1] )
str