0 votes
in Python by
In-place swapping of two numbers

1 Answer

0 votes
by
p, q = 20, 40

print(p, q)

p, q = q, p

print(p, q)

Output:

20 40

40 20

Related questions

+1 vote
asked Feb 15, 2021 in Python by SakshiSharma
+1 vote
asked Jan 30, 2022 in Python by sharadyadav1986
...