#Week 5 Ch 6 Ex 4: #This program uses a function that returns a value that is the maximum #of two numbers #Written by Greg Lamb #Last Modified on 04/24/2015 def maximum(numOne, numTwo): if numOne>numTwo: return numOne; else: return numTwo; numOne = float(input("Enter your first number, any number: ")) print("You entered: {}".format(numOne)) numTwo = float(input("Enter your second number, any number: ")) print("You entered: {}".format(numTwo)) print("The larger of the two numbers is: {} ".format(maximum(numOne,numTwo)))
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