Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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: -2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Check that you have given a brief background statement.

Answered: 1 week ago

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago