0

python quiz

One of the following 10 statements generates an error. Which one? x = [1,"abcd",2,"efgh",[3,4]] # Statement 1 y = x[0:50] # Statement 2 z = y # Statement 3 w = x # Statement 4 x[1] = x[1][0:3] + 'd' # Statement 5 y[2] = 4 # Statement 6 z[0] = 0 # Statement 7 x[1][1:2] = 'yzw' # Statement 8 w[4][0] = 1000 # Statement 9 a = (x[4][1] == 4) # Statement 10

7th Aug 2017, 5:41 PM
Atanu Pradhan
Atanu Pradhan - avatar
5 Respuestas
+ 4
You kind of can't *mut8* the immutable ;)
7th Aug 2017, 5:45 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
@sayan That's not really mutation, but... I see what you did there ;)
7th Aug 2017, 7:11 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
statement 8 OBVIOUSLY before that no error..
7th Aug 2017, 6:43 PM
sayan chandra
sayan chandra - avatar
7th Aug 2017, 6:54 PM
sayan chandra
sayan chandra - avatar
- 2
hmmm ya not mutation but as a view of a user who sees the output...thinks its muted😂😂
7th Aug 2017, 7:19 PM
sayan chandra
sayan chandra - avatar