ItLec prelims pt2 Flashcards
a sequence of characters
string
computers do not deal with characters they deal with___________
numbers (binary)
Conversion of character to number is called ______ and the reverse is called ___________
encoding
decoding
___________ and _________ are some of the popular encodings used.
ASCII and Unicode
In python a string is a sequence of _________ characters
unicode
was introduced to include every character in all languages and bring uniformity in encoding
Unicode
You can access individual characters using
indexing
Trying to access a char out of index range will raise an
indexerror
An index must be an integer any other type will result in
TypeError
Strings are Immutable
T or F
T
To delete tge string entirely is possible using the
del keyword
returns an enumerate object, it contains the index and value of all the items
enumerate()
starts with a backslash and is interpreted differently
escape sequence
To ignore the escape sequence inside a string place a
r or R infront of the string
is available with the string object is very versatile and powerful for FORMATTING strings
format()
format strings contain ___________ as place holders
curly braces{}
Format are separated from the field name using
Colon
is a module to manipulate and manage date and time information
datetime
the handling for date time is
datetime.datetime
you need to import datetime before ytou use it
T or F
T
To format datetime objects use
strftime()
to perfrom arithmetic operations in datetime use
timedelta
to work with timezones in datetime objects use
pytz library
are named locations on disk to store related information
Files