Empty Set in Python

Level 112 keystrokes

This creates and prints an empty set using the set() constructor.

Python code

# set() called with no arguments creates a new, empty set
# {} would be an empty dict, so an empty set is shown as set()
1print(set())

Output

set()
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this Python code and how often they appear.

  • (× 2
  • )× 2

More Python examples at level 1

← Python typing practice