-2

I've seen people use @s in Python but I never knew what they where for, I cant seem to figure out what it is used for. What is it used for?

MaoKnight
  • 116
  • 2
  • 10

1 Answers1

2

The @ symbol is used for class, function and method decorators.You can use a decorator to add some modified things that wouldn't be returned by function normally. Here is a nice example.

Ali Gajani
  • 14,340
  • 9
  • 53
  • 86