Python Classroom Notes 20/April/2024

Functions

  • Function is a reusable block of code
  • Syntax
def <name_of_function>(arg1, arg2...):
    ...
    ...
    ...
    return <value>
  • Lets write a function to determine
    • if the number is even or odd:
      • return True if the number is even, False otherwise
    • if the number is prime or not
      • return True if the number is prime, False otherwise
  • Refer Here for functions demonstrations

Lists in python

Docstring

references:

  • Useful packages
    • Snoop
    • heartrate

Writing pythonic code

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner