Python DateTime module
The datetime classes are categorize into 6 main classes –
- date
- Its attributes are
year
,month
andday
- Its attributes are
- time
- Its attributes are
hour
,minute
,second
,microsecond
andtzinfo
- Its attributes are
The datetime classes are categorize into 6 main classes –
year
, month
and day
hour
, minute
, second
, microsecond
and tzinfo
UTC, or Coordinated Universal Time, is the primary time standard by which the world regulates date and time.
astimezone()
–> it helps to convert the time of a particular time zone into another time zonelocaltime()
–> it helps to get the current local time4 basic collection data types
Specialised collection data types
shallow copy
, a reference of object is copied in other object.
External object id changes but Internal object id remains same
deep copy
, a copy of object is copied in other object.
External and internal object ids changes
contents
p = [1,2,3]
q = [1,2,3]
p == q # --> True --> val is same
p is q # --> False --> not same obj
a = "first"
b = "first"
a is b # --> True
refers to same obj if values are same
Pass by Value
nor Pass by Reference
Pass by Object Reference
functions treated like any other variable
then they are term as First-class functions
- Assign to a variable.
- Pass the function as a parameter to another function.
- Return a function from another function.
nested function
def print_msg(msg):
def printer():
print(msg)
printer()
print_msg("Hello")
# Output: Hello
[Read More]
add functionality
to an existing function or class
.Multithreading allows you to break down
an application into multiple sub-tasks
and run these tasks simultaneously.
If you use multithreading properly, your application speed
, performance
, and rendering can all be improved.
Multithreading is defined as the ability of a processor to execute multiple threads concurrently
.
Multiprocessing refers to the ability of a system to support more than one processor
at the same time.
Applications in a multiprocessing system are broken to smaller routines
that run independently. The operating system allocates these threads to the processors improving performance of the system.