Hi i was wondering if someone can help me understand ho to add one function to this code to find the maximum value in the list. We can assume the list is not empty. Then call that function to find the maximum, and then print it out.
import random
class Node:
def init(self,val):
self.val = val
self.next = None
def print_list(values):
n = values
while n != None:
print(n.val)
n = n.next
values = None
for i in range(10):
num = random.randint(0,100)
val = Node(num)
val.next = values
values = val
print_list(values)