Hello friends of the internet,
I just began working in Python a few days ago and I am trying to create a starter program. All I am looking to do is create something that can take an input set of numbers (non-negative), from the user, and print the value of the highest number in the set.
I have read a few things about recursion functions that may be able to accomplish this task, but like I said, I'm a newby! If any of you professionals can show me something that can do just that I would be incredibly grateful.
def Max(list):
if len(list) == 1:
return list[0]
else:
m = Max(list[1:])
return m if m > list[0] else list[0]
def main():
list = eval(raw_input(" please enter a list of numbers: "))
print("the largest number is: ", Max(list))
main()