Answers for "can a function output be save as a variable python"

0

can a function output be save as a variable python

#You have to return something in a function to have it in a variable.

def ex_one():
  print('Hi!')
#This won't work.

def ex_two():
  msg = 'Hi!'
  return msg

#This will work.
var = ex_two
Posted by: Guest on September-14-2021

Code answers related to "can a function output be save as a variable python"

Python Answers by Framework

Browse Popular Code Answers by Language