Question

Given three ints a,b,c, correctly return exactly one of the following strings : -"same" when a,b,c...

Given three ints a,b,c, correctly return exactly one of the following strings :
-"same" when a,b,c are all the same values

-"unique" when a,b,c are all different values

-"overlap" otherwise  (exactly two match)

def status(a,b,c):

#insert solution here

0 0
Add a comment Improve this question Transcribed image text
Answer #1
def status(a, b, c):
    if a == b and b == c:
        return 'same'
    elif a == b or a == c or b == c:
        return 'overlap'
    else:
        return 'unique'

Add a comment
Know the answer?
Add Answer to:
Given three ints a,b,c, correctly return exactly one of the following strings : -"same" when a,b,c...
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
  • /**    Given a String and an array of two Strings,    return a three String...

    /**    Given a String and an array of two Strings,    return a three String array containing the strings in alphabetical order.    Note: Capital letters count    sort3Strings("wallace", {"washington", "irving"}) -> {"irving", "wallace", "washington"}    sort3Strings("wallace", {"washington", "Irving"}) -> {"Irving", "wallace", "washington"}    sort3Strings("Washington", {"irving", wallace"}) -> {"Washington", "irving", "wallace"}    sort3Strings("washington", {"washington", "Washington"}) -> {"Washington", "washington", "washington"} **/ public static String[] sort3Strings(String stringValue, String[] stringArray) {    //your code here    return new String[1]; }//end sort3Strings   ...

  • C programming Write a function that gets a 2-d array of given dimensions of ints. It...

    C programming Write a function that gets a 2-d array of given dimensions of ints. It returns true if the array contains two rows with exactly the same values in the same order, and returns false otherwise, bool contains_equal_rows(int height, int width, const int ar[height] [width]) Examples: On input {{1,2,3,4}, {2,3,4,1}, {1,2,3,4}} it returns true. On input {{1,2,3,4}, {2,3,4,5}, {3,4,5,6}} it returns false. On input {{1,1,1,1}, {2,2,2,2}, {1,1,1,6}} it returns false.

  • Given two int values, return their sum. Unless the two values are the same, then return...

    Given two int values, return their sum. Unless the two values are the same, then return double their sum sum_double (1, 2) 3 sum_double (3, 2) 5 sum_double (2, 2)8 def sum_double(a, b) Python Warmup-2 > front_times prev next chance Given a string and a non-negative int n, we'll say that the front of the string is the first 3 chars, or whatever is there if the string is less than length 3. Retun n copies of the front Expected...

  • /** Given an int array, return true if the array contains duplicate values. duplicateInts({3}) -> false...

    /** Given an int array, return true if the array contains duplicate values. duplicateInts({3}) -> false duplicateInts({1, 2}) -> false duplicateInts({7, 7}) -> true duplicateInts({1, 2, 3, 4, 5}) -> false duplicateInts({1, 2, 3, 2, 4, 5}) -> true **/ public static boolean duplicateInts(int[] numbers) { //your code here return false; }//end duplicateInts /** Given a String array, return true if the array contains duplicate values. Note: Capital letters count duplicateStrings({"a"}) -> false duplicateStrings({"a", "b", "c", "d"}) -> false duplicateStrings({"a",...

  • Example 18.7 The Mistuned Piano Strings Two identical piano strings of length 0.775 m are each tuned exactly to 400 Hz....

    Example 18.7 The Mistuned Piano Strings Two identical piano strings of length 0.775 m are each tuned exactly to 400 Hz. The tension in one of the strings is then increased by 1.0%. If they are now struck, what is the beat frequency between the fundamentals of the two strings? SOLVE IT Conceptualize As the tension in one of the strings is changed, its fundamental frequency changes. Therefore, when both strings are played, they will have different frequencies and beats...

  • python . Write the function poker_hand that takes a list of exactly five distinct Card objects...

    python . Write the function poker_hand that takes a list of exactly five distinct Card objects as an argument, analyzes the list, and returns one of the following strings that describes the hand: "Four of a kind' (four cards of the same rank) 'Full house' (three cards of one rank, and two cards of a different rank) . 'Flush' (five cards of the same suit) 'Three of a kind' (exactly three cards of the same rank) • 'One pair' (at...

  • C++ Given the following recursive function: string mystery(strings) { == == if ($ "") return "";...

    C++ Given the following recursive function: string mystery(strings) { == == if ($ "") return ""; if (toupper(s[ 0 ]) 'A' || toupper(s[ 0 ]) || toupper(s[ 0 ]) 'I' || toupper(s [ 0 ]) || toupper(s [ 0 ]) 'U') 'E' 'O' == == == { return s.substr(0, 1) + mystery(s.substr(1, s.size() 1)); } return + mystery(s.substr(1, s.size() - 1)); } Show all the calls to the function and what each one returns to its predecessor. string result =...

  • You are following the inheritance of three genes: A, B and C. A and B are...

    You are following the inheritance of three genes: A, B and C. A and B are on the same chromosome; C is on a different chromosome from A and B (for example; A and B are on chromosome 1 and C is on chromosome 4). Which option correctly represents the genotype of an individual who is heterozygous for all three genes? Select one: O a. AB/ab; C/c O b. A/a, B/b, C/c c. AaBbcc d. ABC/abc

  • write C code that uses pointers, arrays, and C strings. 3. Write a function called pow_xy....

    write C code that uses pointers, arrays, and C strings. 3. Write a function called pow_xy. The function should be passed 2 parameters, as illustrated in the prototype below. int pow_xy(int *xptr, int y); Assuming that xptr contains the address of variable x, pow_xy should compute x to the y power, and store the result as the new value of x. The function should also return the result. Do not use the built-in C function pow. For the remaining problems,...

  • Parallelogram Program Write a program that prints the following parallelogram pattern given the the following two...

    Parallelogram Program Write a program that prints the following parallelogram pattern given the the following two inputs. Here are the rules: Your program must work with any length greater than 1. Your program must use the character the user inputs to draw the parallelogram. Your program must not use global variables or global code other than a call to main(). Your program output must match my out exactly. I have provided you with the strings you need for the output...

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
ADVERTISEMENT