write a method to that takes to char agruments and returns 0 if the both arguments are equal and the method returns -1 if the first argument is smaller than the second and one is the second argument is smaller than the first
Answers
Answered by
6
The following codes have been written using Python.
We can create functions using in Python. Here, we've created a function called that takes two arguments. Using conditional statements, we check if the arguments are equivalent. If they are, 0 is printed. If the first argument is greater than the second, -1 is printed and if the first argument is lesser than the second, 1 is printed. We check for their relationship using relational operators, ==, > and <.
Similar questions