The assignment seems simple enough:
"Create a function named max_num()
that takes a list of numbers named nums
as a parameter.
The function should return the largest number in nums
"
But something in the code I’ve written keeps returning 50 which is the first item in the list. It makes me think that something I’m doing creates a loop that doesn’t actually loop. It’s only looking at the first item in the list and then stopping.
Can someone please explain to me, in really simple terms (I’m new to coding and get lost in the lingo), why this code isn’t working?
I really appreciate the help. I keep having similar problems with my loops and haven’t been able to figure out what I’m doing wrong despite checking other forum post and just simply having the answer shown to me.
Please, I really need this explained like you are talking to someone with absolutely no coding experience, because that’s exactly who you’re dealing with.