This question was asked 9 years ago but I'm giving my answer because the question is still relevant today
we can do this for both numbers and strings
A) Finding the largest number in a given list:
your_list = [54, 26, 29, 48, 56, 32, 15, 17]
largest_num = -99999999 # Any value below zero is ok if you know there
# are larger numbers in the list
for i in your_list: # Checking every item in the list
print("current number:", i) # Printing every item in the list
# regardless of their value
if i > largest_num: # Is it larger than -99999999?!
largest_num = i # then value of largest number should be equal
# to the value of i(as integer)
print("largest number:",largest_num) # Let's print the result when
# we're done
B) Finding the largest string in a given list:
my_list = ["a", "b", "c", "A", "B", "C", " "]
largest_str = my_list[0]
for i in my_list:
print("current str:", i)
if i > largest_str:
largest_str = i
print("largest_str:", largest_str)