Apr-28-2017, 03:16 AM
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
PS This kind of operations are usually done on lists
- Assign a new variable, e.g.
the_greatest
, to value ofnum1
- Compare
num2
tothe_greatest
, and ifnum2
is bigger - assignthe_greatest
to value ofnum2
- etc..
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.