Skip to content

Tag: function

why returning None in functions python?

first image I was having problem when I run this code I raise exception in function then why none is printing sec image And in this case none is not printing.. pls help Answer when a python function does not have a return statement it automatically return None. In the first image, the print(numcheck(5)) pass …

changing the name of a function in a loop

I didn’t find the answer my problem I have function with names stage_1(), stage_2() e.t.c (to 8). Can I run it using loop? I know this is wrong. what is the right way? Answer I have function with names stage_1(), stage_2() e.t.c (to 8). Actually this is a very bad idea. Can I run it using loop? For sure…