How To Create Decorator Functions In Python
Вставка
- Опубліковано 2 чер 2024
- In this video, I go over how to create and use decorator functions in the Python Programming Language. Decorators allows us to add additional functionality to a function without changing the original function's source code.
As always, well stated and well paced. Thank you!
thank you for share
but where is the result of 1+7?
Good video. You have one mistake in your code. At 3:20 you should have used "return orig_func(x,y)".
3:18 lul, it's 2024, and Python STILL can't into string interpolation that doesn't make you throw up?
idk, print(f"") works flawlessly, idk why he went for that useless shit
@@lilsos6892 meanwhile Ruby 20 years ago and to this day:
puts "String with #{any_expression}" # notice the lack of random magic numbers and letters
There is a lot of ways.
print("{0}, {1}".format(x, y))
print("{x}, {y}".format(x=x, y=y))
print("%s, %s" % (x, y))
print(f"{x}, {y}") => best and most readable!
print(x + " " + y) => (might need to put it in str(x), str(y))
There are many different ways that Python allows you to concatenate strings and printing. The beauty of Python is that it has variety.