Pass values to a subroutine in Python

Home > Search
  by

In this example, values "Hello" and then "World" are passed into the foo subroutine.

foo("Hello")
foo("World")

 

The values passed into the foo subroutines are placed in the bar variable.

def foo(bar):
  print(bar)

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments