Python Forum
Returning the highest value out of 3 values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Returning the highest value out of 3 values
#3
If this is an assignment - which I suspect it is  -and you can't use max - as @wavic suggested - you can just do a simple step-by-step search
  1. Assign a new variable, e.g. the_greatest  Wink, to value of num1
  2. Compare num2 to the_greatest  , and if num2 is bigger - assign the_greatest to value of num2
  3. etc..
Just write it in Python Cool

PS This kind of operations are usually done on lists
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Messages In This Thread
RE: Returning the highest value out of 3 values - by volcano63 - Apr-28-2017, 03:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Methods that return the highest score from the list erfanakbari1 7 7,173 Mar-26-2019, 08:32 PM
Last Post: aankrose
  how to get the highest monthly average temperature? nikhilkumar 2 7,050 Jul-25-2017, 02:33 PM
Last Post: DeaD_EyE
  Numerically determining the highest a ball travels when shot straight up JakeWitten 3 3,437 Apr-22-2017, 04:37 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020