A
A
amoor2016-09-27 20:57:22
Python
amoor, 2016-09-27 20:57:22

How to print the result of a function?

I can't display the result of the function. I do everything exactly according to the example - it does not output anything at all.
For example, here it is:

def my_func(name):
  name = input('What is your name?: ')
  print(name)
my_func(name)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Tsilyurik, 2016-09-27
@spidespidepide

my_func(name)
It would be better like this:
What did you expect?

def my_func( name ):
  name = input('What is your name?: ')
  print( name )

my_func( "xxx" )

[[email protected] own.WORK]$ python3 draft.py 
What is your name?: aaa
aaa

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question