226k views
5 votes
Write a function definition for a function which takes one parameter and returns twice that parameter

User Darajan
by
2.9k points

1 Answer

1 vote

Answer:

The function in python is as follows:

def twice(num):

return 2 * num

Step-by-step explanation:

This defines the function; The function receives num as its parameter

def twice(num):

This returns twice of num

return 2 * num

User Ae
by
3.8k points