Skip to content

Commit

Permalink
Merge pull request #346 from tv3141/variable_swapping_exercise_using_…
Browse files Browse the repository at this point in the history
…list

Use list instead of tuple in variable swapping exercise
  • Loading branch information
valentina-s authored Feb 3, 2017
2 parents 7afe993 + a00db22 commit 7b04c07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _episodes/03-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ Omitting ending index: ["sep", "oct", "nov", "dec"]
> Compare it to:
>
> ~~~
> left, right = right, left
> left, right = [right, left]
> ~~~
> {: .python}
>
Expand All @@ -488,7 +488,7 @@ Omitting ending index: ["sep", "oct", "nov", "dec"]
> > ~~~
> > {: .output}
> >
> >In the first case we used a temporary variable `temp` to keep the value of `left` before we overwrite it with the value of `right`. In the second case, we pack `right` and `left` into a tuple and then unpack it again into `left` and `right`.
> >In the first case we used a temporary variable `temp` to keep the value of `left` before we overwrite it with the value of `right`. In the second case, `right` and `left` are packed into a list and then unpacked into `left` and `right`.
> {: .solution}
{: .challenge}

Expand Down

0 comments on commit 7b04c07

Please sign in to comment.