+ 1
Python - Why does trying and change "n" rise an exception?
Result is "b2": try: s = ['a','c'] n = [0,2] s[1:1] = 'b' n[1:1] = 1 except: pass print(s[1],n[1])
2 Réponses
+ 2
n [1:1] is an iterable. So right hand side of equation must be an iterable too. 'b' is an iterable so we haven't exception for that.