#python
Read more stories on Hashnode
Articles with this tag
a = (1) b = (1) a is b >>> a = (1) >>> b = (1) >>> a is b True In the code snippet above, both a and b are defined as integers within parentheses....
Why alx always use add_integer = __import__(‘0-add_integer’).add_integer When you try this in your Python shell >>> from 0-add_integer import...
A context manager in Python is an object that enables the management of resources and defines the setup and cleanup actions associated with those...
str and repr In Python, __str__ and __repr__ are special methods that provide a string representation of an object. These methods are defined within a...
Tuples Slicing I'm going to walk through this with an example Write a function that adds 2 tuples. Prototype: def add_tuple(tuple_a=(),...
>>>from datetime import date >>>now = date.today() >>>now datetime.date(2003, 12, 2) >>>now.strftime("%m-%d-%y. %d %b %Y is a %A on the %d day of...