Max()


#1

maximum = 10
print maximum

this was my code which is not running, pls help


#2

max() is inbuilt function in python.
It takes collection of items/iterable data type and returns largest item from it.

Read the theory of the exercise..
also take a look at documentaion..

max()


#3

pls type the code , which will be acceptable


#4

Have you read the theory of the exercise that is given there ?


#5

yes, but i am not able to run this code....!


#6

I give you one example..

suppose you have collection of numbers say..

12, 13, 45, 36, 34

You can either write a small program that will find largest value from this collection or you simply ask max() function to do this for you.

like this..

print max(12, 13, 45, 36, 34)

It will print the largest value from it which is 45.
Now take a look at theory again and try to do the same thing ?


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.