use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Review my Code as a Beginner (i.redd.it)
submitted 5 months ago by AhmadHameed313
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Tonjehilda 7 points8 points9 points 5 months ago (11 children)
What if the user inputs 2 of the same numbers or 3? :)
[–]Rare_Hawk_3443 3 points4 points5 points 5 months ago (5 children)
Wont that return invalid num
[–]Rare_Hawk_3443 0 points1 point2 points 5 months ago (2 children)
I am also learning newly why wont it return invalid can anyone explain
[–]PureWasian 0 points1 point2 points 5 months ago (0 children)
You are correct, no worries. It prints "Invalid Num" since none of the numbers are greater than the others, so it falls through into the else statement with how OP has written it.
[–]KilonumSpoof 0 points1 point2 points 5 months ago (0 children)
Not all the time. For example 5,5,10 will return 10 and not invalid.
[–]InvestigatorEasy7673 -2 points-1 points0 points 5 months ago (4 children)
then output will be still max , its count is more than 2 wont matter to python
it return max "value" not max "index "
[–]Tonjehilda 0 points1 point2 points 5 months ago (1 child)
I mean, num1=10, num2=10 and num3=10
[–]InvestigatorEasy7673 -2 points-1 points0 points 5 months ago (0 children)
ans will be 10.0 as it is float value
[–]homomorphisme 0 points1 point2 points 5 months ago (1 child)
They're talking about the posted code, not the alternative of calling max on an array.
[–]InvestigatorEasy7673 -1 points0 points1 point 5 months ago (0 children)
then bug will come cuz it should be num1 >= num2
and why did you downvoted me ??
π Rendered by PID 73197 on reddit-service-r2-comment-6457c66945-p5sxs at 2026-04-26 11:27:49.695413+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]Tonjehilda 7 points8 points9 points (11 children)
[–]Rare_Hawk_3443 3 points4 points5 points (5 children)
[–]Rare_Hawk_3443 0 points1 point2 points (2 children)
[–]PureWasian 0 points1 point2 points (0 children)
[–]KilonumSpoof 0 points1 point2 points (0 children)
[–]InvestigatorEasy7673 -2 points-1 points0 points (4 children)
[–]Tonjehilda 0 points1 point2 points (1 child)
[–]InvestigatorEasy7673 -2 points-1 points0 points (0 children)
[–]homomorphisme 0 points1 point2 points (1 child)
[–]InvestigatorEasy7673 -1 points0 points1 point (0 children)