0

max,min,count

ltr=['a','v','c'] ltr.append('a') max(ltr) min(ltr) ltr.count('a') ltr.reverse() print(ltr) when i executed the above code max and min funtions not given either error or result , it just moved to next command but even count function is also not executed but i expected the result will come as 2. and print command (the last line in code) is executed. please explain whether max, min are only meant for integer data type list and why they have not given any error message when i used them on string data type list? please explain why count function is not executed any result and also given any error?

23rd Oct 2016, 5:48 PM
k harsha vardhan
k harsha vardhan - avatar
2 Answers
+ 2
You forgot to use print(). ltr=['a','v','c'] ltr.append('a') print(max(ltr) ) print(min(ltr) ) print(ltr.count('a') ) ltr.reverse() print(ltr)
23rd Oct 2016, 9:16 PM
Zen
Zen - avatar
0
thank u
19th Dec 2016, 11:31 AM
k harsha vardhan
k harsha vardhan - avatar