2. Write a function my_mult_operation(a,b,operation). The input argument, operation , is a string that is either 'plus',

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

2. Write a function my_mult_operation(a,b,operation). The input argument, operation , is a string that is either 'plus',

Post by answerhappygod »

2 Write A Function My Mult Operation A B Operation The Input Argument Operation Is A String That Is Either Plus 1
2 Write A Function My Mult Operation A B Operation The Input Argument Operation Is A String That Is Either Plus 1 (40.55 KiB) Viewed 25 times
2. Write a function my_mult_operation(a,b,operation). The input argument, operation , is a string that is either 'plus', 'minus', 'mult', 'div', or 'pow', and the function should compute: a + b, a – b, a *b, alb, and a for the respective values for operation. A couple of test cases are given below. In [ ]: 1 def my_mult_operation(a,b,operation): 2 # write your function code here 3 4 return out
3. Consider a triangle with vertices at (0,0), (1,0), and (0, 1). Write a function my_inside_triangle(x,y) where the output is the string 'outside' if the point (x, y) is outside of the triangle, 'border' if the point is exactly on the border of the triangle, and 'inside' if the point is on the inside of the triangle. In [9]: 1 def my_inside_triangle(x,y): 2 # write your function code here 3 u z w N 4. return position
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply