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?
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)
0
thank u