Number:
1234, 3.1415, 3+4j, 0b1111, Decimal(), Fraction()
Examples of numbers, including integers, floats, complex, binary, Decimal, and Fraction.String:
'spam', "Bob's", b'a\x01c', u'sp\xc4m'Examples of strings, including regular, byte, and unicode strings.List:
[1, [2, 'three'], 4.5], list(range(10))List examples, including nested lists and lists generated from a range.Tuple:
(1, 'spam', 4, 'U'), tuple('spam'), namedtupleExamples of tuples, including a basic tuple, a tuple from a string, and namedtuple.Dictionary:
{'food': 'spam', 'taste': 'yum'}, dict(hours = 10)Dictionary examples, including key-value pairs and using dict() to create a dictionary.Set:
set('abc'), {'a', 'b', 'c'}Examples of sets, including a set created from a string and a set using curly braces.File:
open('eggs.txt'), open(r'/home/gajen/user.txt', 'wb')Examples of working with files, opening files for reading and writing in binary mode.Boolean:
True, FalseExamples of boolean values.None:
NoneExample of None, used to represent the absence of a value.Functions, modules, classes
These represent functions, modules, and classes used in Python.Advanced:
Decorators, Generators, Iterators, MetaProgrammingAdvanced Python concepts like decorators, generators, iterators, and metaprogramming.
Note: Things to know as a programmer.
[]= brackets
Brackets are used for lists and indexing.()= parentheses
Parentheses are used for function calls and grouping expressions.{}= braces/curly braces
Curly braces are used for dictionaries and sets.