# basic email regex in python
import re
string = "The emails are john.doe@example.com, alex@example.com"
pat = r"\b[^\s]+@[^\s]+\.[^\s]+\b"
m = re.findall(pat, string)
print(m)
# done
# basic linked list in python
class Node:
def __init__(self, value=None, next=None):
self.value = value
self.next = next
class LinkedList:
def __init__(self, head=None):
if not head:
self.head = Node()
# and other attributes can be added.
# one liner fibonacci function to generate a list of fib numbers in O(n) time
# obviously uses the walrus operator so valid from python3.8
fib = lambda n: (lambda n, l: ( [l.__setitem__(i,(l[i-2] + l[i-1])) for i in range(2, n)]))(n, l:=[0,1]+[0]*(n-2)) and l
print(fib(50))
# :)