Question: please used in basic python language! thank you Write a small program that can compare numbers in two lists with the same length. For example:

please used in basic python language! thank youplease used in basic python language! thank you Write a small programthat can compare numbers in two lists with the same length. For

Write a small program that can compare numbers in two lists with the same length. For example: Sample data list 1: list 2: [2, 5, 3, -9, 7.5, 100] [3, -2.5, 1, 0, 8, 100] Part a) Save the comparison result in a new list called compare , such that: When the number in list 1 is bigger than the corresponding number in list 2, assign a comparison result of 1 in the new list; When the number in list 1 is smaller than the corresponding number in list 2, assign a comparison result of -1 in the new list; When the number in list 1 is equal to the corresponding number in list 2, assign a comparison result of O in the new list. Sample output: [-1, 1, 1, -1, -1, 0] - 1 ls1 [2, 5, 3, -9, 7.5, 100] 2 ls2 [3, -2.5, 1, 0, 8, 100] 3 4 # Start your code below 5 # Part a 6 Part b) Find out which list "wins", in the sense that it has more larger numbers than smaller numbers as compared to the numbers in the other list. For example, in the sample data given above, list 1 "wins" list 2 on two occassions (5 vs -2.5 and 3 vs 1); list 1 "loses" to list 2 on three occassions (2 vs 3, -9 vs 0, and 7.5 vs 8); and they "tie" on one occassion (100 vs 100). So list 2 is the winner given the sample data. Print the name of the winning list as in the sample output below (or print "They tie!" instead of the name of the winning list if the two lists have equal wins and losses). Sample output: List 2 wins! Noted that your program should still be applicable when numbers in the two lists change, but still all numeric and with the same length

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!