Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

The code has to be UNIQUE . Please don't copy it from somewhere on the Internet or else my work will be charged plagiarised. The

The code has to be UNIQUE. Please don't copy it from somewhere on the Internet or else my work will be charged plagiarised.

The testing is a thing to test if the programs pass or not so please make sure it goes well

The question is not hard and just takes a short time to complete so please try to finish it asap.

Please, remove the word "Pass" under the description and type the code in.

#!/usr/bin/python3 import unittest # -------------------------------------------------------------- # Judging sameness # -------------------------------------------------------------- def same(a, b, c) : ''' Assume that a, b, c are numbers. Return 'all the same' if they are all equal, 'all different' if they are all different in value, or 'neither' otherwise. For example, same(9, 9, 9) returns 'all the same' same(9, 8, 2) returns 'all different' same(9, 2, 9) returns 'neither' ''' pass (Remove this word to type in the word) # -------------------------------------------------------------- # The Testing # -------------------------------------------------------------- class myTests(unittest.TestCase): def test1(self): self.assertEqual(same(1, 1, 1), 'all the same') def test2(self): self.assertEqual(same(2, 9, 3), 'all different') def test3(self): self.assertEqual(same(7, 7, 3), 'neither') def test4(self): self.assertEqual(same(6, 6, 6), 'all the same') def test5(self): self.assertEqual(same(4, 2, 4), 'neither') def test6(self): self.assertEqual(same(18, 18, 2), 'neither') def test7(self): self.assertEqual(same(14, 3, 7), 'all different')

if __name__ == '__main__': unittest.main(exit=True)

# -------------------------------------------------------------- # The End # --------------------------------------------------------------

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_2

Step: 3

blur-text-image_3

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students explore these related Programming questions

Question

Famous slogan in India?

Answered: 3 weeks ago

Question

Dr.br.ambedkar for the development views ?

Answered: 3 weeks ago

Question

Classify Various Phases of clinical Trials?

Answered: 3 weeks ago