O'Reilly logo
live online training icon Live Online training

Python Functions

Effective programming

Topic: Software Development
Noah Gift
Alfredo Deza

Many people wrongly believe that to program properly in Python, it’s necessary to know all of its many moving parts back to front. But the single most important part of modern Python programming—the part you should learn first—is the function. What can you do with a function? Build command-line tools, web applications, GPU programming, serverless, distributed computing, and machine learning. In the cloud and machine learning era, the function rules.

Begin your Python journey by mastering functions. Experts Alfredo Deza and Noah Gift walk you through using this critically important subset of the Python language to write readable code and straightforward implementations for distributed computing and data analysis tasks—boosting your efficiency as a programmer.

What you'll learn-and how you can apply it

By the end of this live online course, you’ll understand:

  • How to use data structures to store and retrieve information
  • How to execute functions as command-line tools
  • How to do web framework integration with functions and Flask

And you’ll be able to:

  • Improve your efficiency by using a subset of Python
  • Use functions in Python to perform distributed computing and data analysis tasks
  • Make machine learning predictions with scikit-learn
  • Work with functions in pandas for data science

This training course is for you because...

  • You’re a data scientist, student, or developer learning Python, and you want to understand the most efficient path forward.
  • You’re looking for the most straightforward way to write professional Python without the distraction of nonessential information.

Prerequisites

  • Familiarity with Python basic concepts (useful but not required)

Recommended preparation:

Recommended follow-up:

About your instructors

  • Noah Gift is lecturer and consultant in both the UC Davis Graduate School of Management’s MSBA program and Northwestern’s graduate data science program, MSDS, where he teaches and designs graduate machine learning, AI, and data science courses and consults on machine learning and cloud architecture for students and faculty. These responsibilities include leading a multicloud certification initiative for students. He’s the author of close to 100 technical publications, including two books on subjects ranging from cloud machine learning to DevOps. Noah has approximately 20 years’ experience programming in Python. He’s a Python Software Foundation Fellow, an AWS Subject Matter Expert (SME) on machine learning, an AWS Certified Solutions Architect and AWS Academy Accredited Instructor, a Google Certified Professional Cloud Architect, and a Microsoft MTA on Python. Over his career, he’s served in roles ranging from CTO, general manager, and consulting CTO to cloud architect at companies including ABC, Caltech, Sony Imageworks, Disney Feature Animation, Weta Digital, AT&T, Turner Studios, and Linden Lab. In the last 10 years, he’s been responsible for shipping many new products that generated millions of dollars of revenue and had global scale. Currently, he’s consulting startups and other companies. Noah holds an MBA from UC Davis, an MS in computer information systems from Cal State Los Angeles, and a BS in nutritional science from Cal Poly San Luis Obispo.

  • Alfredo Deza is a passionate software engineer, speaker, author, and former Olympic athlete with almost two decades of DevOps and software engineering experience. He currently teaches several courses about Python and Machine Learning Engineering, and gives worldwide lectures about software development, personal development, and professional sports. Alfredo has written several books about DevOps and Python, and continues to share his knowledge about resilient infrastructure, testing, and robust development practices in courses, books, and presentations.

Schedule

The timeframes are only estimates and may vary according to how the class is progressing

Introduction to statements in Python (55 minutes)

  • Group discussion: What’s your experience with Python?
  • Presentation: Executing commands in Python; storing and retrieving data with lists, dictionaries, and tuples
  • Hands-on exercise: Use data structures to find duplicates in the filesystem
  • Q&A

Break (5 minutes)

Python functions (55 minutes)

  • Group discussion: What’s your experience with functions?
  • Presentation: How functions work; nested functions and other patterns; testing functions for robustness and confidence
  • Hands-on exercise: Build a user prompt and add tests to it
  • Q&A

Break (5 minutes)

Mapping functions to command-line tools (55 minutes)

  • Group discussion: What’s your experience with Click?
  • Presentation: Building a command-line tool with Click
  • Hands-on exercise: Create a command-line tool that works with pandas
  • Q&A

Break (5 minutes)

Mapping functions to web services (50 minutes)

  • Group discussion: What’s your experience with continuous integration? Presentation: Building a machine learning web service tool with Flask
  • Hands-on exercise: Create your own web API that integrates with Google Cloud

Wrap-up and Q&A (10 minutes)