Answers for "stop function on condition python"

1

stop a function from continuing when a condition is met python

# use return e.g
def test_function(input):
  if input == 5:
    return 
  else:
    print(input)
    
#f you run 
test_function(5)
#the function will simply just end
Posted by: Guest on June-12-2021
1

stop function python

def some_fuction():
  print("This is all I do!")
  return
# A simple return will end a function
Posted by: Guest on February-27-2020

Code answers related to "stop function on condition python"

Python Answers by Framework

Browse Popular Code Answers by Language