Subject:
Computers and TechnologyAuthor:
kendalCreated:
1 year agoAnswer:
here!!
Explanation:
# Write code here...
def max_int_in_list(my_list):
highest = my_list[4]
for num in my_list:
if num > highest:
highest = num
return highest
my_list = [5, 2, -5, 10, 23, -21]
biggest_int = max_int_in_list(my_list)
print biggest_int
Author:
troyg747
Rate an answer:
4A version of the required program written in python 3 is given below.
my_list = [5, 2, -5, 10, 23, -21]
def max_int_in_list(my_list):
#iniate the function named max_int_in_list which takes in a list argument
maximum = my_list[0]
#set the first value in the list as maximum
for num in my_list:
#iterate through every value in the list
if num > maximum:
#Check if any of the iterated values in the list is greater than the set maximum value
maximum = num
#if so set the Number as the new maximum value
return maximum
#return the maximum value
print(max_int_in_list(my_list))
A SCREENSHOT of the program output is attached.
Author:
maggieecn5
Rate an answer:
8Rate an answer:
0Don't worry! There are several alternative approaches you can try to resolve your query. Here are some tips to help you find answers in different ways:
Remember, the process of finding answers often involves persistence, creativity, and an open mind. By exploring various resources, reaching out to others, and being proactive in your search, you increase your chances of finding the information you need. Happy quest for knowledge!