In: Computer Science
Using Python:
Part 1:
Write the following function in a file called listlab.py
list4(): This function takes four formal parameters. If all four inputs are of type int and/or float, return the largest of the four inputs. Otherwise, return a list containing the four input parameters. Remember the type() function from Chapter 2.2; you may also want to use max().
Notes:
Every function must have a docstring, and variable names other than input parameters and loop control variables must have meaningful names. We will be grading for this.
Do not put a call to your function at the bottom of the file.
Part 2:
Write a Python function `make_triangle(trianglechar, triangleheight) that will return a string with an isosceles right triangle based on the two formal parameters triangle_height giving the triangle height and triangle_char that gives the symbol to be printed.
Important notes:

def list4(a, b, c, d):
permittedtype = [int, float]
if type(a) in permittedtype and type(b) in permittedtype and \
type(c) in permittedtype and type(d) in permittedtype:
return max(a, b, c, d)
else:
return [a, b, c, d]
def make_triangle(trianglechar, triangleheight):
i = 1
s = ''
while i <= triangleheight:
s += trianglechar * i + '\n'
i += 1
return s.strip()
************************************************** Thanks for your question. We try our best to help you with detailed answers, But in any case, if you need any modification or have a query/issue with respect to above answer, Please ask that in the comment section. We will surely try to address your query ASAP and resolve the issue.
Please consider providing a thumbs up to this question if it helps you. by Doing that, You will help other students, who are facing similar issue.
Python 3.7.4 (default, Jul [GCC 6.3.0 20170516] on li def list4(a, b, c, d): 2 permittedtype [int, float] 3 if type(a) in permittedtype and type(b) in permittedtype and \ 4 ** type(c) in permittedtype and type(d) in permittedtype return max(a, b, c, d) 6 else: 7 return [a, b, c, d] CO def make_triangle(trianglechar, triangleheight) 10 i = 1 11 12 S = 13 while i = triangleheight 14 * i'\n' trianglechar 15 S i += 1 16 17 return s.strip() 18 19 print (make_triangle('*', 6)) 20 21