-3

I have a Python Task for online course on Udacity although I put the right code for the task it still gives me that is wrong answer. Can any one tell me why?? You are required to complete the function maximum(no_list). the function is expected to return the maximum numbers in that list.

Example:

input : [5,20,12,6]
output: 20

no_list = [1,2,3,4]
  def maximum(no_list): 
    #complete the function to return the highest number in the list

  print(maximum(no_list))
mimo
  • 23
  • 5

1 Answers1

0

Simply return the maxnum instead of printing it

Change print To return

For Example

no_list = [1,2,3,4]

def maximum(no_list):

  maxnum= max(no_list)

  return maxnum

Maxwell D. Dorliea
  • 1,086
  • 1
  • 8
  • 20