Write a negate function that takes a number and returns the negation of that number. Also write a large_num function that takes a number, and returns True if that number is bigger than 10000, and False otherwise. Additionally, write some code to test your functions.

Respuesta :

Answer:

# negate function

def negate(number):

# return the negation of number

return -number

# large_num function

def large_num(number):

# return true or false based on the condition

return number > 10000

print(negate(67))

print(large_num(12356))

Explanation:

The above functions is commented and written in python.

The negate function take a number as parameter and return the negation of the number by adding the minus sign to the front of the number.

The large_num function take a number as parameter and return True or False depending on the results of evaluating the Boolean expression. If number is greater than 10000, it returns True else it returns False.

print(negate(67)) will output -67

print(large_num(12356)) will output True.