What is the issue?(Trying to make the computer find the biggest number in the list) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the issue?(Trying to make the computer find the biggest number in the list)

def max_int_in_list(my_list): Num = my_list biggestNum = my_list[0] if Num > biggestNum: checkotherNum = my_list[0-5] else: print(biggestNum + “ is the biggest number”) my_list = [5, 2, -5, 10, 23, -21] print(max_int_in_list(my_list)) # trying to make the program look for the biggest number and printing it

7th Feb 2024, 4:29 AM
Jacob Ortega
1 Answer
+ 3
Would you describe how do you want the program to work? There are few issues in the code, and there is another way to do with a built-in function.
7th Feb 2024, 4:53 AM
Wong Hei Ming
Wong Hei Ming - avatar