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 ▸

What is the outcome of the following code? print(2*[3,4,5])


Generate an array of integers from 0 to 99 and split it into two smaller arrays. Each smaller array will contain half of the original.


Write a program that computes the sum of all numbers up to a input number n


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 .