Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to swap two variables without using third variable python

a = 10
b = 20

print(a, b)

a = a + b
b = a - b
a = a - b

print(a, b)
Comment

PREVIOUS NEXT
Code Example
Python :: python cv2 write to video 
Python :: flask flash 
Python :: IndentationError: unexpected indent 
Python :: static files in django 
Python :: how to join two dataframe in pandas based on two column 
Python :: django queryset limit 
Python :: django queryset to list 
Python :: estimate time to run a chunk of code in python 
Python :: pandas insert row 
Python :: python lists tuples sets dictionaries 
Python :: if else in 1 line python 
Python :: if condition dataframe python 
Python :: pandas order dataframe by index of other dataframe 
Python :: days to int 
Python :: geopandas geometry length 
Python :: Get the square root of a number in Python 
Python :: anagram python 
Python :: sentence transformers 
Python :: tf MaxPooling2D 
Python :: add values of two columns pandas 
Python :: python error handling 
Python :: python code execution time 
Python :: flask dockerize 
Python :: django admin create project 
Python :: is vs == python 
Python :: python requests no certificate example 
Python :: how to return a value from a function in python 
Python :: How to count a specific number in a python list? 
Python :: seaborrn set figsize 
Python :: sqlalchemy convert row to dict 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =