Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
find max() value
#9
(Nov-23-2019, 05:53 PM)tuxandrew Wrote: The values from "testname.txt" has been appended to the following lists.
f=open("testname.txt","r")

list1=[20,40,60,80,40]
list2=[50,60,70,40,30,60]
list3=[40,60,70,80,30,50]
list4=[20,50,60,70,40,60]

r=0
for j in f:
    if r==0:
        r=1
         k=i.split()
         list_names=[]            #will hold the list names
         list_names.append(k[1])
         list_names.append(k[2])
         list_names.append(k[3])
         list_names.append(k[4])
        else:
            w=j.split()
            list_highest=[]
            list_highest.append(w[1])
            list_highest.append(w[2])
            list_highest.append(w[3])
            list_highest.append(w[4])
            print("The highest values of",list_names[j],"=",max(list_highest)) #,  max(list_highest))  ==> is not working
Any alternates to find max() of each list elements?
Any help would be appreciated.


The max(), not working.Any corrections to that is very helpful.
TuxAndrew
Linux - RedHat,cPANEL CentOS,Ubuntu,Azure/AWS Administrator,
Assistance, Analysis and Diagnosis. Skype: tuxandrew,

[email protected]
Reply


Messages In This Thread
find max() value - by tuxandrew - Nov-23-2019, 04:36 PM
RE: find max() value - by ndc85430 - Nov-23-2019, 04:41 PM
RE: find max() value - by tuxandrew - Nov-23-2019, 04:52 PM
RE: find max() value - by ThomasL - Nov-23-2019, 04:55 PM
RE: find max() value - by tuxandrew - Nov-23-2019, 05:07 PM
RE: find max() value - by buran - Nov-23-2019, 05:16 PM
RE: find max() value - by tuxandrew - Nov-23-2019, 05:53 PM
RE: find max() value - by tuxandrew - Nov-23-2019, 07:18 PM
RE: find max() value - by perfringo - Nov-23-2019, 10:13 PM
RE: find max() value - by ThomasL - Nov-23-2019, 06:34 PM
RE: find max() value - by ThomasL - Nov-23-2019, 10:05 PM
RE: find max() value - by tuxandrew - Nov-24-2019, 06:22 AM
RE: find max() value - by perfringo - Nov-24-2019, 02:14 PM
RE: find max() value - by tuxandrew - Nov-24-2019, 03:29 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020