Add emojis to any input on Mac OSX

To add emojis to any text input area on a mac, you just need to press the following keys control + command + space, and you get ? your emojis!

Adding emojis on the mac.

Adding emojis on the mac.

Swapping Values In Python

When swapping values in python there really is not reason to use a temporary variable. We can take advantage of tuples to initiate the swap, which allows us to do the swap without a temporary variable.

 

Below is an example of non-idiomatic swapping.

a = ‘A’
b = ‘B’
temp = a
a = b
b = temp

 

Below is an example of utilizing the power of a Python tuple.

a = ‘A’
b = ‘B’
(a, b) = (b, a)