Login
📚 Introduction to Python Programming
Chapters ▾
⇩ Download ▾

3.6 Chapter summary

Highlights from this chapter include:

Table 3.5 Chapter 3 reference.
CodeDescription
ord(c)Gets an integer representing the Unicode code point of a character.
chr(i)Converts a Unicode code point (integer) into a One-character string.
'\n'Escape sequence for the newline character.
'\t'Escape sequence for the tab character.
f"{number:.02d}"Creates a string by formatting an integer to be at least two digits.
f"{number:.2f}"Creates a string by formatting a float to have two decimal places.
id(object)Gets the identity (memory location) of an object.
type(object)Gets the type (class name) of an object.
my_list = ["a", "b", "c"]Creates a list of three strings.
my_tuple = ("a", "b", "c")Creates a tuple of three strings.
my_list[0]Gets the first element ("a") of my_tuple.
my_tuple[-1]Gets the last element ("c") of my_tuple.