Versions Compared

Key

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

...

Constant Floating-point value

ValuePython Expression
Hexa decimal a10xa1

Image Modified

3.2e-12
  • Horizontal Tab character
  • Newline (ASCII Linefeed) character
  • The character with hexadecimal value a0
  • '\t\n\xa0'
  • "\t\n\xa0"
  • '''\t\n\xa0'''
  • """\t\n\xa0"""

Basic Operators

Python Arithmetic Operators

...

Code Block
a = ["Jake", "John", "Eric"]
b = ["John", "Jill"]

print(set(a).difference(set(b)))


Dictionary

Info

Python dictionaries are similar to lists in that they are mutable and can be nested to any arbitrary depth (constrained only by available memory).

A dictionary can contain any type of Python object, including another dictionary. The keys in a given dictionary do not need to be the same type as one another, nor do the values.

Dictionary elements are accessed by key. Unlike with list indexing, the order of the items in a dictionary plays no role in how the items are accessed.

Even though dictionary access does not rely on item order, as of version 3.7 the Python language specification does guarantee that the order of items in a dictionary is maintained once the dictionary is created

Keys are unique within a dictionary while values may not be. The values of a dictionary can be of any type, but the keys must be of an immutable data type such as strings, numbers, or tuples

.


Code Block
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}

...