Computer Science
Write expression to convert the values 17, len('ab') to (i) integer (ii) str (iii) boolean values
Python Data Handling
20 Likes
Answer
(i) int(17), int(len('ab'))
(ii) str(17), str(len('ab'))
(iii) bool(17), bool(len('ab'))
Answered By
12 Likes
Related Questions
int('a') produces error. Why ?
int('a') produces error but following expression having int('a') in it, does not return error. Why?
len('a') + 2 or int('a')
Evaluate and Justify:
(i) 22.0/7.0 - 22/7
(ii) 22.0/7.0 - int(22.0/7.0)
(iii) 22/7 - int (22.0)/7
Evaluate and Justify:
(i) 22 / 17 = 37 / 47 + 88 /83
(ii) len('375')**2