0
Please help me to understand
def main(): print(min(5, 6))  def min(n1, n2): smallest = n1 if n2 < smallest: smallest = n2  main() # Call the main function What is wrong with the code? Traceback (most recent call last): File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module> start(fakepyfile,mainpyfile) File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start exec(open(mainpyfile).read(), __main__.__dict__) File "<string>", line 3 print(min(5, 6)) ^ IndentationError: expected an indented block [Program finished] It shows like this
2 Answers
0
You didn't mentioned the error?
I think you are not returning any value from min function so it prints nothing ?
0
indentation errors, here is the fixed version
def main():
print(min(5, 6))
def min(n1, n2):
smallest = n1
if n2 < smallest:
smallest= n2
else:
smallest=n1
return smallest
main()