Skip to content

Instantly share code, notes, and snippets.

@TheMuellenator
Last active August 3, 2023 23:36
Show Gist options
  • Save TheMuellenator/cbcd9cbc2d2c36b652ca1337248b8201 to your computer and use it in GitHub Desktop.
Save TheMuellenator/cbcd9cbc2d2c36b652ca1337248b8201 to your computer and use it in GitHub Desktop.
Python Variables Coding Exercise Solution
def test(A, B):
a = A
b = B
# TODO: Below this comment write your code.
c = a
a = b
b = c
# Leave this line alone as well
return (a, b)
@hangginny
Copy link

I had this solution but for some reason when I checked, there were error messages..

@Elelu
Copy link

Elelu commented Nov 13, 2021

solved same way

@Monles
Copy link

Monles commented Jan 6, 2022

@hangginny @Elelu Do you leave the indentation before the three lines of your answer?

@rafiahmedraju
Copy link

Same here. I have the same solution but getting the error message

@NMMRSTT
Copy link

NMMRSTT commented Feb 21, 2022

a, b = b, a #this is a more Python-specific way to do this

@Lexeuz
Copy link

Lexeuz commented Dec 9, 2022

I did it this way:
a, b = b, a

@Dannysesi
Copy link

same issue did it this way and im getting an error

@kingkupo1985
Copy link

the inbuilt udemt checker doesn't work I had that exact code and it keeps saying error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment