Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Deleting a dictionary element by method

Code Block
d.pop('foo')


Copying a dictionary

Method 1)

Code Block
d2 = dict(d1)

Method 2)

Code Block
d2 = dict(d1.items())

Method 3)

Code Block
d2 = {}
d2.update(d1)


Generator

Random number generation

...