compare two list in python by R4R Team

program to compare two list-

print("Enter number in first list")
print("Enter number in second list")

print("List1 is",l1)
print("List2 is",l2)

if l1>l2:
print("list1 contain maximum number")
elif l2>l1:
print("List2 contain maximum number")
print("No comparision exist")


Enter number in first list
1 2 3 4
Enter number in second list
1 2 3
List1 is [1, 2, 3, 4]
List2 is [1, 2, 3]
List1 contain maximum number

Enter number in first list
Enter number in second list
4 3 2
List1 is [8]
List2 is [4, 3, 2]
List1 contain maximum number

-In this program, we comapre two list and try to find in which list the maximum number exist, and print that list which contain greator number.

Leave a Comment:
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!