Hi guys. need a help( | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Hi guys. need a help(

Fill in the blanks to swap the variable values with one single statement. a = 7 b = 42 a ... b = ... , ...

8th Jun 2021, 3:22 PM
Andrey Zinin
8 Answers
+ 4
What is your try..? It's explain in lesson.. complete lesson or read again.. Python allows assigning with camma (,) separated ex: a,b=7,42
8th Jun 2021, 3:28 PM
Jayakrishna 🇮🇳
+ 1
Andrey Zinin Maybe there is a bug in the quiz, but here you see that it works: https://code.sololearn.com/ceTdSRcavozh/?ref=app
8th Jun 2021, 9:08 PM
Denise Roßberg
Denise Roßberg - avatar
0
if you mean this
8th Jun 2021, 3:32 PM
Andrey Zinin
0
It works . Check this code a=7 b=42 a,b=b,a print(a,b)
8th Jun 2021, 3:34 PM
Jayakrishna 🇮🇳
0
ok, it is work in ide but in quiz it is does't
8th Jun 2021, 3:35 PM
Andrey Zinin
0
i'l try anything. I don't understand why it is not working
8th Jun 2021, 3:36 PM
Andrey Zinin
0
How many empty slots there ..? I think only way : a ,b = b, a If not work then it may be a bug..
8th Jun 2021, 3:43 PM
Jayakrishna 🇮🇳
- 1
a, b = b,a does not work
8th Jun 2021, 3:32 PM
Andrey Zinin