# Maximum of Two Values # This function accepts two integer values and returns the value that is the greater of the two # Written by Beth Mela # Last Updated April 27, 2015 # Define the function def Max(value1, value2): myFunctionsReturnValue = max(value1, value2) return myFunctionsReturnValue # Get input from user value1= input('Please enter the first value:') value2=input('Please enter the second value:') # Call the function maximumValue = Max(value1, value2); print('The greater value of the two values entered is {}.'.format(str(maximumValue)))
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question