+ 2
Is it possible, that some of the python quiz questions are not correct?
For ex. it ask, what is the output, and there is no print function. Or a = [2, 4, 6] b = a a[1] = 7 ask what is b[1] the correct answer is 7, but it marks it wrong.
6 Respuestas
+ 3
Never came across this one, but if it is indeed like you wrote it, the correct answer is of course 7.
Doesn't matter if the assignment of a[1] is done after a = b.
The latter mean "a is b" rather than "a equals b". Both variables point to the same reference point and changing one of its elements affect all variables pointing to it.
+ 1
Challenges are written by other programmers, so there could easily be errors. Even if Sololearn corrects errors, I'm sure one or two could slip through the cracks.
+ 1
Oh! come on! When you assign a list, it does NOT copy the values and it just assigns a REFERENCE to b.
So b[1] IS 7, there is no problem about that. Someone screwed up, went to the quiz factory and was up-voted for a wrong answer... Sorry, you'll have to remember it...
+ 1
Thanks guys, i hope, someone at Sololearn will check the wrong answer, and correct it.
0
a [1] is 4, so b [1] is also 4
0
pretty sure 7 is not the correct answer. The value is changed after b is set to a.