+ 1

No output is shown. But why ?

#A python code to finding out #maximum number among the three def max(num1,num2,num3): #finding out of maximum number if (num1 >num2 )and (num1 >num3 ): print ("num1 is the largest number",num1 ) elif (num2 >num1 )and (num2 >num3 ): print ("num2 is the largest number",num2 ) else : print ("num3 is the largest number",num3 ) #driver code max(10,20,30) print("The largest number is:max")

3rd Nov 2022, 4:06 AM
Dipanita Saha
Dipanita Saha - avatar
1 Answer
+ 5
1. Your "driver code" is inside the else block inside the function. Just fix the indentation. 2. The last print call outputs the string "max". Is this your intention?
3rd Nov 2022, 4:09 AM
Emerson Prado
Emerson Prado - avatar