Skip to content

Commit

Permalink
馃憣 IMPROVE: Syntax Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadawais committed Jul 28, 2018
1 parent de26dfb commit faaa12c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion demo/python.py
@@ -1,17 +1,22 @@
#
# Swap two vars in Python
#

import numpy as np

# Swaps
data = np.random.random(2)

print(data)

data[0], data[1] = data[1], data[0]

print(data)

# Does not swap.
data = np.random.random((2, 2))

print(data)

data[0], data[1] = data[1], data[0]

print(data)

0 comments on commit faaa12c

Please sign in to comment.