Question

In the function below, return the string 'negative' if the numeric parameter number is in fact...

In the function below, return the string 'negative' if the numeric parameter number is in fact negative, or, return the string 'positive' if the parameter number is positive, otherwise return string 'zero'

use function "def string_indicating_positivityOrNegativity(number):"

python 3

0 0
Add a comment Improve this question Transcribed image text
Answer #1
def string_indicating_positivityOrNegativity(number):
    if number<0:
        return 'negative'
    elif number>0:
        return 'positive'
    else:
        return 'zero'
Add a comment
Know the answer?
Add Answer to:
In the function below, return the string 'negative' if the numeric parameter number is in fact...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • CODIO python problem Write a function isRed() that accepts a string parameter and looks for the...

    CODIO python problem Write a function isRed() that accepts a string parameter and looks for the presence of the word ‘red’ in the string. If it is found, return boolean True otherwise False. Finally output the result of calling the function with the value in text.

  • HW7.26. Return a CSV string from a list of numbers The function below takes a single...

    HW7.26. Return a CSV string from a list of numbers The function below takes a single parameter, a list of numbers called number_list. Complete the function to return a string of the provided numbers as a series of comma separate values (CSV). For example, if the function was provided the argument [22, 33, 44], the function should return '22,33,44'. Hint: in order to use the join function you need to first convert the numbers into strings, which you can do...

  • help ASAP 3. Write a string C++ function named UnsignedPartialSum() that takes two string parameters and...

    help ASAP 3. Write a string C++ function named UnsignedPartialSum() that takes two string parameters and an int parameter. If both string parameters represent binary numbers and the int parameter is equal to a positive number less than or equal to the length of the longest string parameter, the function should return a binary string whose length is equal to two times the length of the maximum length of the two string parameters whose value is equal to the sum...

  • python function will Return True if string x contains 3 vowels in a row, in consecutive...

    python function will Return True if string x contains 3 vowels in a row, in consecutive locations, false otherwise. assuming that 'vowels' refer to the following lowercase lttrs: a,e,i,o,u programs fails partially, only allowed to use float, str, int, appen, split, strip, len, range def vowels_three(x): for i in range (o, len(x), 2): if x[i] not in ('a,e,i,o,u'): return False return True

  • Write a function oneSpaceAfterPeriod( String Parameter ) that will return a string with one space after...

    Write a function oneSpaceAfterPeriod( String Parameter ) that will return a string with one space after every period. Another function twoSpaceAfterPeriod (String Parameter) that will return a string with two spaces after every period.

  • Write a Python program which defines a function named "divide_two_numbers" that accepts two numeric parameters and...

    Write a Python program which defines a function named "divide_two_numbers" that accepts two numeric parameters and divides the first parameter by the second. Your divide_two_numbers function must check the second parameter before dividing; if it is zero, raise an ZeroDivisionError exception which includes the string "second parameter was zero!" as a parameter instead of processing the division. Your main function must call your divide_two_numbers function at least twice; one call must use two normal parameters to verify normal operation, the...

  • Python help def palindrome_word: ''' (str) -> bool The parameter is a string consisting only of...

    Python help def palindrome_word: ''' (str) -> bool The parameter is a string consisting only of lowercase alphabetic letters. It may or may not be a palindrome. Return True if and only if the parameter is a palindrome. The empty string is considered to be a palindrome. ''' def palindrom_phrase: ''' (str) -> bool The parameter is a string that may or may not be a palindrome. Return True if and only if the parameter is a palindrome, independent of...

  • please use python Question 4: Define a function named q40 that accepts a string as a...

    please use python Question 4: Define a function named q40 that accepts a string as a parameter. After verifying that the string includes only includes numeric digits, count the number of even (E) and odd (O) digits. Finally, create a new string made up of these values and their sum. Repeat this process until your end result is a string containing 123 For example, '15327' contains 1 even digit (E-1), 4 odd digits(O-4) and the sum of these is 5...

  • Positive and negative: Return these four results using C++ reference parameter Write a function, named sums(),...

    Positive and negative: Return these four results using C++ reference parameter Write a function, named sums(), that has two input parameters; an array of floats; and an integer, n, which is the number of values stored in the array. Compute the sum of the positive values in the array and the sum of the negative values. Also count the number of positives and negative numbers in each category. Write a main program that reads no more than 10 real numbers...

  • PYTHON 1- Write a function that receives a string value as a parameter, converts its first...

    PYTHON 1- Write a function that receives a string value as a parameter, converts its first character to uppercase and returns the first character. 2- Test your function by writing a main, which calls your function and prints its return value. 3- Save your program in a file called firstChar.py and use the following link to submit your file.  

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT