19/19 help plz~


#1

god =["50","b","c","dd","b"]
for x in god:
if x=="b" :
x="g"
print x
break
print x
else:
print "what is this?"

why? thank u so much~!


#2

@pythonmaster1031,

god =["50","b","c","dd","b"]
print str(god)
for x in god:
 if x=="b" :
     x="g"
     print x
     break   #the FOR-loop is stopped
     print x #never used, as AFTER =break=
 else:
     print "what is this? " +str(x)
     
print "==========="
string = "abcdefghijklmnop"
for char in string:
    print char,
else:
    print "nothing"

[output]

['50', 'b', 'c', 'dd', 'b']
what is this? 50
g
===========
a b c d e f g h i j k l m n o p nothing