Whats is the difference between a function and a procedure?

A procedure is a named set of instructions that can be called on by throughout the program.A function is a procedure that returns a value.Both functions and procedures can take parameters.

JH

Related Python Mentoring answers

All answers ▸

Given a list of N numbers, use a single list comprehension to produce a new list that only contains those values that are: (a) even numbers, and (b) from elements in the original list that had even indices .


Using the shared code editor, write a recursive function for calculating a factorial of an input parameter.


Why would I use dictionaries instead of a list?


[Student query] Why do we import libraries/modules such as Numpy and Matplotlib into Python?