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
2. Write a function my_mult_operation(a,b,operation). The input argument, operation , is a string that is either 'plus',
-
answerhappygod
- Site Admin
- Posts: 899604
- 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',
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!