+ 1
def text(msg="my default text"): return msg print(text(msg="Hi"))
20th Jun 2020, 8:30 PM
Per Bratthammar
Per Bratthammar - avatar
+ 1
Hi! You make first a module file with the name _whatever_.py. In that file you create a function with the name text(), that contain a keyword argument and that return the argument. That id actually all you need to do. /Regards Per B
20th Jun 2020, 8:20 PM
Per Bratthammar
Per Bratthammar - avatar
0
You can always assign it to a variable and print it out later: my_var = wt.text(msg="hi") But if you call the function from the interactive prompt, it will probably print it out without using print, if you don’t assign it. It is one of the specially things with the interactive prompt.
20th Jun 2020, 8:48 PM
Per Bratthammar
Per Bratthammar - avatar