Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help this with python 3 Write a function, compare_results, that accepts two parameters of the same type. If these parameters have equal value, print
please help this with python 3
Write a function, compare_results, that accepts two parameters of the same type. If these parameters have equal value, print out "Results match!" and the value of the parameter, except if the parameters passed in are lists. You can use the logical expression "type(variable_name) is list" to test if the variable variable_name's value is a list. If they do not match print out "Results don't match!" and the values of the two parameters. Hint: this should help you with the comparing task of homework 6! For example: Test Result compare_results(0, 0) Results match! value:0 compare_results(0, 1) Results don't match! value 1:0 value 2: 1 compare_results([1, 2, 4], [1, 2, 4]) Results match! compare_results([1, 2, 4], -2) Results don't match value 1: [1, 2, 4 value 2: -2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started