+ 1

Swap the value in one line

a=10 or b= 20

22nd Jun 2018, 5:04 AM
Nishant Shrimali
3 Respostas
+ 7
Not sure I understand the question. Do you mean like: a = 10 b = 20 a, b = b, a print("a =", a) # a = 20 print("b =", b) # b = 10
22nd Jun 2018, 5:11 AM
David Ashton
David Ashton - avatar
22nd Jun 2018, 5:55 AM
Abdur-Rahmaan Janhangeer
Abdur-Rahmaan Janhangeer - avatar
+ 1
a,b=b,a
22nd Jun 2018, 6:51 AM
Aravind Shetty
Aravind Shetty - avatar