On 4/19/19 12:23 AM, Sayth Renshaw wrote:
On Friday, 19 April 2019 17:01:33 UTC+10, Sayth Renshaw  wrote:
Set the first item in the list as the current largest.
         Compare each subsequent integer to the first.
                 if this element is larger, set integer.

def maxitwo(listarg):
     myMax = listarg[0]
     for item in listarg:
         if item > myMax:
             myMax = item

     return myMax

Sayth


When you understand what it is you intend to write (barring DL Neil's comments), and THEN write it, you write the correct thing. Thus endith the lesson.

--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to