Web Development
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.
Read More[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.
Read MoreWrite 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.
Read MoreWrite 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
Read MoreAssume 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…
Read MoreWrite 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.
Read MoreWrite 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.
Read MoreWrite the definition of a function square which receives a parameter containing an integer value and returns the square of the value of the parameter.
LANGUAGE: PYTHON CHALLENGE: Write the definition of a function square which receives a parameter containing an integer value and returns the square of the value of the parameter.
Read MoreWrite the definition of a function printGrade, which takes one parameter containing a string value and returns nothing.
LANGUAGE: PYTHON CHALLENGE: Write the definition of a function printGrade, which takes one parameter containing a string value and returns nothing. The function prints “Grade: ” followed by the string parameter.
Read MoreGiven that add, a function that expects two int parameters and returns their sum, and given that two variables , euro_sales and asia_sales, have already been defined.
LANGUAGE: PYTHON CHALLENGE: Given that add, a function that expects two int parameters and returns their sum, and given that two variables , euro_sales and asia_sales, have already been defined. Write a statement that calls add to compute the sum of euro_sales and asia_sales and that associates this value with a variable named eurasia_sales.
Read MoreGiven print_larger, a function that expects two parameters and returns no value and given two variables, sales1 and sales2, that have already been defined, write a statement that calls print_larger, passing it sales1 and sales2.
LANGUAGE: PYTHON CHALLENGE: Given print_larger, a function that expects two parameters and returns no value and given two variables, sales1 and sales2, that have already been defined, write a statement that calls print_larger, passing it sales1 and sales2.
Read MoreWrite the code to call a function named send_two and that expects two parameters: a float and an int.
LANGUAGE: PYTHON CHALLENGE: Write the code to call a function named send_two and that expects two parameters: a float and an int. Invoke this function with 15.955 and 133 as arguments.
Read More