Python short course: Function basic in Python

 To define a function in python, first, use 'def' to declare that a function, then follow the function name and parameters. Following this is the function body. An easy example is below.



In [1]: def func_test(a):
   ...:     print(a)
   ...: 

In [2]: func_test('I love Python')
I love Python

Comments

Popular posts from this blog

Lab's weekly topic - week 50 2023 - Detailed explanation for encoder of U-Net

Lab's weekly topic - week 49, 2023 - What's limitations and possible solutions for a new AI tools to detect blood poisoning?

Lab's recommendation: Awesome books to learn machine learning and AI (continue updating)