print("Enter length of elements You want to sort\t")
a=input()
print("Enter those elements")
b=raw_input()
c=len(b)
if(a==c):
print max(b)
else:
print("Entered number of elements doesn't matches with length")
Here variable c
wants to store the number of elements that list b
contains, so that it can compare with the length, and produce result.
But it is showing some error. I would like to know is there any other method available to assign length of list into a variable. In above program every time the output is displaying as
Enter length of elements You want to sort
5
Enter those elements
1 2 3 4 5
Entered number of elements doesn't matches with length
Even though the length and Number of elements matches