Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project 0: Using Pytest This source file performs simple arithmetic calculations. However, some of them evaluate incorrectly. If you run pytest, you will see

""" Project 0: Using Pytest This source file performs simple arithmetic calculations. However, some of them evaluate incorrectly. If you run pytest, you will see that some of the tests will fail. You will also notice that the pylint score is fairly low. Your job is to fix the functions and make the pylint score >= 8.5 """ global integers def add(num1, num2): """Adds num1 to num2""" return num1 + num2 def subtract(num1, num2): """Subtract num1 from num2""" return num2 - num1 def multiply(num1, num2): """Multiply num1 and num2""" return num1 * num2 def divide(num1, num2): return num2 / num1 def int_to_string(num): x = "" for c in x: if x == num: print(x) if num == x: print(x) else: pass return num def main(): global integers integers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] print(add(integers[0], integers[0])) print(subtract(integers[0], integers[0])) print(multiply(integers[0], integers[0])) print(divide(integers[0], integers[0])) print(int_to_string(integers[0])) if __name__ == "__main__": main()

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

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions

Question

If Y is b(100, 1/2), approximate the value of P(Y = 50).

Answered: 1 week ago