Skip to main content
Bumped by Community user

Code-:

a=10
b=5
temp=a
a=b
b=temp
a=10
b=5
temp=a
a=b
b=temp

I am studying pythonPython and I stumbled upon the classic program-: The swapping programSwapping Program.

It is simple.:

temptemp binds to aa.

aa binds to bb.

bb binds to temptemp.

I can decode what is happening in memory as well. I will show it here-:

enter image description here

But sadly, I can't wrap my head around how we got to this program? What was the problem solving part of this problem. How did we decide that this would be our program? What logic was used to build this program? The reason is simple while I might not come across swapping 3 variables, but if I learn the basics programs properly, I make sure that I learn the complex topics as well.

Code-:

a=10
b=5
temp=a
a=b
b=temp

I am studying python and I stumbled upon the classic program-: The swapping program.

It is simple.

temp binds to a.

a binds to b.

b binds to temp

I can decode what is happening in memory as well. I will show it here-:

enter image description here

But sadly, I can't wrap my head around how we got to this program? What was the problem solving part of this problem. How did we decide that this would be our program? What logic was used to build this program? The reason is simple while I might not come across swapping 3 variables, but if I learn the basics programs properly, I make sure that I learn the complex topics as well.

Code:

a=10
b=5
temp=a
a=b
b=temp

I am studying Python and I stumbled upon the classic program: The Swapping Program.

It is simple:

temp binds to a.

a binds to b.

b binds to temp.

I can decode what is happening in memory as well. I will show it here:

enter image description here

But sadly, I can't wrap my head around how we got to this program? What was the problem solving part of this problem. How did we decide that this would be our program? What logic was used to build this program? The reason is simple while I might not come across swapping 3 variables, but if I learn the basics programs properly, I make sure that I learn the complex topics as well.

added 5 characters in body
Source Link

Code-:

a=10, 
b=5
temp=a
a=b
b=temp

I am studying python and I stumbled upon the classic program-: The swapping program.

It is simple.

temp binds to a.

a binds to b.

b binds to temp

I can decode what is happening in memory as well. I will show it here-:

enter image description here

But sadly, I can't wrap my head around how we got to this program? What was the problem solving part of this problem. How did we decide that this would be our program? What logic was used to build this program? The reason is simple while I might not come across swapping 3 variables, but if I learn the basics programs properly, I make sure that I learn the complex topics as well.

Code-:

a=10,b=5
temp=a
a=b
b=temp

I am studying python and I stumbled upon the classic program-: The swapping program.

It is simple.

temp binds to a.

a binds to b.

b binds to temp

I can decode what is happening in memory as well. I will show it here-:

enter image description here

But sadly, I can't wrap my head around how we got to this program? What was the problem solving part of this problem. How did we decide that this would be our program? What logic was used to build this program? The reason is simple while I might not come across swapping 3 variables, but if I learn the basics programs properly, I make sure that I learn the complex topics as well.

Code-:

a=10 
b=5
temp=a
a=b
b=temp

I am studying python and I stumbled upon the classic program-: The swapping program.

It is simple.

temp binds to a.

a binds to b.

b binds to temp

I can decode what is happening in memory as well. I will show it here-:

enter image description here

But sadly, I can't wrap my head around how we got to this program? What was the problem solving part of this problem. How did we decide that this would be our program? What logic was used to build this program? The reason is simple while I might not come across swapping 3 variables, but if I learn the basics programs properly, I make sure that I learn the complex topics as well.

Source Link

How was swapping program born?

Code-:

a=10,b=5
temp=a
a=b
b=temp

I am studying python and I stumbled upon the classic program-: The swapping program.

It is simple.

temp binds to a.

a binds to b.

b binds to temp

I can decode what is happening in memory as well. I will show it here-:

enter image description here

But sadly, I can't wrap my head around how we got to this program? What was the problem solving part of this problem. How did we decide that this would be our program? What logic was used to build this program? The reason is simple while I might not come across swapping 3 variables, but if I learn the basics programs properly, I make sure that I learn the complex topics as well.