Python Revision - Section V - OOP
Object-Oriented Programming (OOP) is a programming paradigm based on the concept of objects. Each object is an instance of a class. Each class is defined by its attributes and its methods. Attribut...
Object-Oriented Programming (OOP) is a programming paradigm based on the concept of objects. Each object is an instance of a class. Each class is defined by its attributes and its methods. Attribut...
Map Function The map function allows us to map a function to an iterable object. def square(num): return num**2 my_nums = [1,2,3,4] map(square, my_nums) To obtain the mapp...
*args When a function parameter starts with an asterisk, it allows for an arbitrary number of arguments, and the function takes them in as a tuple of values. def myfunc(*args): return sum(arg...
If we iterate over a list of tuples, we can get each element of each tuple through what we called unpacking: list = [(1,2), (3,4)] for (t1, t2) in list: print (t1, t2) The same behaviour is ...
Numbers In Python we just have: integers and floating-point numbers. Strings Immutability: Once a string is created, the elements within it can not be changed or replaced. Methods: ...
Hi there! First of all, thank you for being here! Let me introduce myself to you: I’m Daniel, a Brazilian computer engineer As you may have noticed, this is just an attempt at a personal blog. I ...