Notes in Python - Advanced

To Subscribe, use this Key


Status Last Update Fields
Published 05/03/2024 izip
Published 05/03/2024 deque
Published 05/03/2024 What is a virtual function?
Published 05/03/2024 WHAT IS __INIT__.PY?
Published 05/03/2024 Print current working directory
Published 05/03/2024 Get current working directory
Published 05/03/2024 Add w to dd = {'spam': 2, 'ham': 1, 'eggs': 3}w = {'toast':4, 'muffin':5}
Published 05/03/2024 super(type[, object-or-type])
Published 05/03/2024 Make a dictionary with key/value tuples form.n = ('name', 'Bob')a = ('age', 40)
Published 05/03/2024 What code is needed to make this work:from tests import test_1(tests is a folder, test_1 is python file)
Published 05/03/2024 Create a lambda function to add two numbers
Published 05/03/2024 What is the advantage of defaultdict?
Published 05/03/2024 from abc import ABCMeta
Published 05/03/2024 What is a mixin?
Published 05/03/2024 from collections import Counter
Published 05/03/2024 What does a single underscore in a variable for a class mean?
Published 05/03/2024 What does a double underscore in a variable for a class mean?
Published 05/03/2024 Read and execute code from an object,which can be a string or a code object.
Published 05/03/2024 code = compile('a = 1 + 2', '<string>', 'exec')exec codeprint(a)
Published 05/03/2024 Explain:def make_adder(x, y):    def add():        return x + y    return add
Published 05/03/2024 Return the canonical string representation of the object.
Published 05/03/2024 What sort algorithm does Python use?
Published 05/03/2024 convert 2 to binary
Published 05/03/2024 convert '11' or '0b11' to integer
Published 05/03/2024 divmod
Published 05/03/2024 what is the parameter for enumerate
Published 05/03/2024 Does regex.py accept strings, lists, or buffers?
Published 05/03/2024 Why is memoryview used?
Published 05/03/2024 v = memoryview(b'abcefg')v[1]
Published 05/03/2024 v = memoryview(b'abcefg')v[1:4]
Published 05/03/2024 v = memoryview(b'abcefg')bytes(v[1:4])
Published 05/03/2024 What is Python's stack depth limit, aka limit to recursion?
Published 05/03/2024 What is a decorator?
Published 05/03/2024 Refactor to use decoratorsdef other_func(*args): pass    other_func = enhanced(other_func)
Published 05/03/2024 memoizes in Python 3
Published 05/03/2024 Create a one-line lambda function that takes 2 the 4th power (2, 4 are the arguments)#=> 16
Published 05/03/2024 eval
Published 05/03/2024 Python is not compiled to machine language, but ____________(with names such as  ___________) which is then interpreted __________.
Published 05/03/2024 complex numbers in Python
Published 05/03/2024 1j**2 ==
Published 05/03/2024 Get rid of the 510.0 / 3.0 == 3.3333333333333335
Published 05/03/2024 A Python list is more like a ______ than an array. 
Published 05/03/2024 A decorator is a ______________________
Published 05/03/2024 The decorator may perform some processing with the decorated function, and ______________________.
Published 05/03/2024 # Refactor this to be a decoratordef target():     print('running target()')target = decorate(target)
Published 05/03/2024 Give an example of idempotent function in python
Published 05/03/2024 What are Magic Methods?
Published 05/03/2024 define infinity
Published 05/03/2024 Is math.pi a constant?
Published 05/03/2024 What is version?class Circle:    'An advanced circle analytics toolkit'        version = '0.1'    &n…
Published 05/03/2024 When a generator function is called, it returns _____ known as ______.
Published 05/03/2024 A Decorator is a ________________________________
Published 05/03/2024 If you need fast random access, use a _____.If you need fast appends or fast pops, use a ______.
Published 05/03/2024 How do coroutines work?
Published 05/03/2024 What is the difference between generators and coroutines?
Published 05/03/2024 What is the limitation of str.strip()?
Published 05/03/2024 Usually, the caller pushes _____ into the coroutine.
Published 05/03/2024 Write a simple coroutine
Published 05/03/2024 The initial call to coroutine is often described as “priming” the coroutine
Published 05/03/2024 Make a class that called as a function.The function should find the minimum of the two argumentsmin_class = MinClass()assert min_class(2,3) == 2
Published 05/03/2024 What is the best way to compare two strings, ignoring case?
Published 05/03/2024 Create a for loop of infinite numbers
Published 05/03/2024 What's the difference between a statement and an expression in Python?
Published 05/03/2024 Make a complex number in Python
Published 05/03/2024 What is del?- neither- method- statement
Published 05/03/2024 a = [True, 'a', 'bar', 'foo']b = (1, 2, a)a.append(3)What is b?
Published 05/03/2024 What is the difference between statements and expressions in Python?
Published 05/03/2024 functools.partial
Published 05/03/2024 An implied loop in _______ is faster than an explicit for loop
Published 05/03/2024 What is one way to speed inner loops in Python?
Published 05/03/2024 ____________ are faster than globals.
Published 05/03/2024 A for-loop with in-line code beats ___________!
Published 05/03/2024 A map with _______ beats for loop.
Published 05/03/2024 Why is len not a method?
Published 05/03/2024 What does it mean when a function returns None?
Published 05/03/2024 What are the two types of sequences?
Published 05/03/2024 What are container sequences?
Published 05/03/2024 What are flat sequences?
Published 05/03/2024 What is memoryview?
Published 05/03/2024 What are the limitations of Python's lambda functions?
Published 05/03/2024 Why would you get an UnboundLocalError?
Published 05/03/2024 After accumulating data in a defaultdict(), restore normal dict behavior:
Published 05/03/2024 What is the difference between == and is?
Published 05/03/2024 What is the difference between repr() and str()?
Published 05/03/2024 ABC
Published 05/03/2024 What is a killer feature for Metaclasses?
Published 05/03/2024 What should have lambda been called?
Published 05/03/2024 what are the 3 main types of lambda functions?
Published 05/03/2024 Write an example of using lambda for delayed computation:
Published 05/03/2024 Why "yield" a good name for the return statement of a generator?
Published 05/03/2024 What are the 4 states of a generator?
Published 05/03/2024 What does the GIL do?
Published 05/03/2024 What is the best way to run long-running concurrent tasks
Published 05/03/2024 Write program that uses futures to compute 8 timesimport randomdef compute():    return sum(random.randint(1, 100) for _ in range(1_000_000)…
Published 05/03/2024 x = 3 + 2jy = 3 - 2jz = x + yprint(z)What is the result?
Published 05/03/2024 What Python function return a DirEntry interator of the current directory?
Published 05/03/2024 Run command with arguments and return a CompletedProcess instance.
Published 05/03/2024 An asynchronous context manager is a context manager that is able to suspend execution in its enter and exit methods.
Published 05/03/2024 If you want to compare the 1st element in an iterable to the last element, when making all adjacent pairs comparsion.
Published 05/03/2024 When is map not faster than listcomp?
Published 05/03/2024 What are dataclasses?
Published 05/03/2024 Run another Python program in Python program
Status Last Update Fields