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

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a ReplyCancel reply

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

Please turn AdBlock off
Plugin for Social Media by Acurax Wordpress Design Studio

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%