Hard to follow your comment.
String formatting.
var: str = "Haha"
print(f"{var:_>20}")
print(f"{var:*^20}")
print(f"{str.lower() = }")
A function declaration with variable types declared.
def concatenate[T: (str, bytes)](first: T, second: T) -> T:
return first + second
Should be written like items[:] = []. Here items[:], which is equivalent to items[0:3], is being set to an empty list.
items = [1, 2, 3]
items [:]=[]
Extend the list 0 times. So items = [] after this. items *= 2 will create items = [1,2,3,1,2,3].
items = [1, 2, 3]
items *=0
Again, not typical spacing used. drink, = bowl only works if bowl is a list/tuple/etc with only one item. Assigns first element of bowl to drink. Usually written as drink = bowl[0].
bowl = ['water']
drink ,= bowl
# is a comment symbol in python, so ignore all stuff after it. n*['.'] creates ['.', '.', '.']. If we only had ['a', 'b', 'c', n*['.']] (no * before n), then we create ['a', 'b', 'c', ['.', '.', '.']]. The * before n unpacks the inner list so we create ['a', 'b', 'c', '.', '.', '.'].
n = 3
['a', 'b', 'c', *n* ['.']] #> ['a', 'b', 'c', '.', '.', '.']
This just assigns a = 1 and assigns _ = (2,3). *_ is syntax for "rest of the list/tuple/sequence/etc".
a, \*_ = (1,2,3)