Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

Notice Board

Per partecipare al corso di Fondamenti di programmazione 2023-24 loggatevi e attivatelo nella vostra pagina dei corsi preferiti. A quel punto il corso appare nel menù personale cliccando sul proprio avatar. Per i materiali degli anni precedenti seguite lo stesso metodo.

To join the Programming/Lab 2023-24 course, log-on and select it on the my courses page. It will appear on the personal menu of your avatar. For earlier years use the same method.

Cool feature about Spyder

ruben.ciranni (4650 points)
8 14 31
in Programming in Python by (4.7k points)
recategorized by
I just found out a cool feature of Spyder and I wanted to share it:

When defining a function you can automatically generate a description of that function by specifying the types of the parameters and of the return value (For example ex(a: int, b: list) -> bool) and pressing enter twice.

That is really useful to always have under control the what the parameters and the returns of each function represent.
318 views

3 Answers

gabrimat (5630 points)
2 4 25
by (5.6k points)
Thank you for sharing
Luigi Pizza (6120 points)
14 20 65
by (6.1k points)
Yes, but they are just a suggestion: Python will not check if a is an int or if b is a list, it is just to make the code easier to read.
ruben.ciranni (4650 points)
8 14 31
by (4.7k points)
Yes, it only generates a docstring which describes the function
KilianS (3590 points)
7 10 27
by (3.6k points)
i also thank you for sharing !