Why we use cmp(listl, list2) in Python?
Answers
Answered by
0
The compare function is used to compare two lists.
Explanation:
- The compare function is used to compare the list of objects mentioned in two lists.
- The result of the output will be either a positive, negative, or a zero value depending upon the value input by the user.
- The compare functions including finding greater, smaller, or checking the equality of the values.
- For example, if the user enters a query to find the largest of two lists, then the compare function will return a positive value, if both lists are equal, then a negative value will be returned.
To know more:
1) Compare formula and function
https://brainly.in/question/9707634.
2) How do different function types compare?
https://brainly.in/question/11106253
Similar questions
Math,
5 months ago
India Languages,
5 months ago
Math,
5 months ago
Computer Science,
11 months ago
English,
1 year ago
Chemistry,
1 year ago
Chemistry,
1 year ago