# Category: Learn To Code

## Write an expression (not a statement!) whose value is the largest of population1, population2, population3, and population4 by calling max2.

LANGUAGE:  PYTHON CHALLENGE: assume that max2 is a function that expects two int parameters and returns the value of the larger one. Also assume that four variables , population1, population2, population3, and population4 have already been defined and associated with int values. Write an expression (not a statement!) whose value is the largest of population1,...

This content requires that you purchase additional access. The price is \$2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

## Write an expression (not a statement!) whose value is the larger of population1 and population2 by calling max.

LANGUAGE:  PYTHON CHALLENGE: max is a function that expects two int parameters and returns the value of the larger one. Two variables , population1 and population2, have already been defined and associated with int values. Write an expression (not a statement!) whose value is the larger of population1 and population2 by calling max....

This content requires that you purchase additional access. The price is \$2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

## Define a function called min that takes two parameters containing integer values and returns the smaller integer of the two. If they have equal value, return either one.

LANGUAGE:  PYTHON CHALLENGE: Define a function called min that takes two parameters containing integer values and returns the smaller integer of the two. If they have equal value, return either one....

This content requires that you purchase additional access. The price is \$2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

## Define a function called isSenior that takes a parameter containing an integer value and returns True if the parameter is greater than or equal to 65, and False otherwise

LANGUAGE:  PYTHON CHALLENGE: Define a function called isSenior that takes a parameter containing an integer value and returns True if the parameter is greater than or equal to 65, and False otherwise...

This content requires that you purchase additional access. The price is \$2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

## Define a function called signOf that takes a parameter containing an integer value and returns a 1 if the parameter is positive, 0 if the parameter is 0, and -1 if the parameter is negative

LANGUAGE:  PYTHON CHALLENGE: Define a function called signOf that takes a parameter containing an integer value and returns a 1 if the parameter is positive, 0 if the parameter is 0, and -1 if the parameter is negative...

This content requires that you purchase additional access. The price is \$2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

## Write the definition of a function absoluteValue that receives a parameter containing an integer value and returns the absolute value of that parameter.

LANGUAGE:  PYTHON CHALLENGE: Write the definition of a function absoluteValue that receives a parameter containing an integer value and returns the absolute value of that parameter....

This content requires that you purchase additional access. The price is \$2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

## [Functions >> functions and if statements] Write the definition of a function powerTo which receives two parameters, a double and an integer.

LANGUAGE:  PYTHON CHALLENGE: [Functions >> functions and if statements] Write the definition of a function powerTo which receives two parameters, a double and an integer. If the second parameter is positive, the function returns the value of the first parameter raised to the power of the second. Otherwise, the function returns 0....

This content requires that you purchase additional access. The price is \$2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

## Write the definition of a function oneLess which receives a parameter containing an integer value and returns an integer whose value is one less than the value of the parameter.

LANGUAGE:  PYTHON CHALLENGE: Write the definition of a function oneLess which receives a parameter containing an integer value and returns an integer whose value is one less than the value of the parameter....

This content requires that you purchase additional access. The price is \$2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

## Write the definition of a function add which receives two parameters containing integer values and returns their sum

LANGUAGE:  PYTHON CHALLENGE: Write the definition of a function add which receives two parameters containing integer values and returns their sum...

This content requires that you purchase additional access. The price is \$2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

## Assume the availability of a function is_prime. Assume a variable n has been associated with positive integer.

LANGUAGE:  PYTHON CHALLENGE: Assume the availability of a function is_prime. Assume a variable n has been associated with positive integer. Write the statements needed to find out how many prime numbers (starting with 2 and going in increasing order with successively higher primes [2,3,5,7,11,13,…]) can be added before exceeding n. Associate this number with the...

This content requires that you purchase additional access. The price is \$2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

## Write the definition of a function max that has three int parameters and returns the largest.

LANGUAGE:  PYTHON CHALLENGE: Write the definition of a function max that has three int parameters and returns the largest....

This content requires that you purchase additional access. The price is \$2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

## Write the definition of a function add, that receives two int parameters and returns their sum.

LANGUAGE:  PYTHON CHALLENGE: Write the definition of a function add, that receives two int parameters and returns their sum....

This content requires that you purchase additional access. The price is \$2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.