Pythonic Programming

The hands-on lab is part of this learning path

Pythonic Programming
course-steps 6 certification 1 lab-steps 2

Lab Steps

keyboard_tab
lock
Logging in to the Amazon Web Services Console
lock
Connecting to the Python Web IDE
lock
Exercise 1 - List, Set, and Dictionary Comprehensions
lock
Exercise 2 - Generators
lock
Exercise 3 - Lambdas

Ready for the real environment experience?

DifficultyIntermediate
Duration1h
Students21
Ratings
3/5
star star star star-border star-border

Description

Lab Overview

Knowing how to write code in a Pythonic style is an important skill that should be mastered!

This Lab is designed to show you how to exploit various Python language features to produce code that is considered to be Pythonic - being clear, concise, readable and maintainable. 

  • Exercise 1 - List, Set, and Dictionary Comprehensions: Complete the code required to dynamically generate Lists, Sets, and Dictionaries using comprehensions
  • Exercise 2 - Generators: Complete the code required to create a Generator Function that yields numbers from the Fibonacci sequence. Also learn to use the builtin functions sum(), min(), max() using Generator Expressions
  • Exercise 3 - Lambdas: Complete the code required to use Lambdas to Map and Filter on lists of numbers

Note: Each exercise has a provided solution to consult with when needed.

Lab Objectives

Upon completion of this Lab, you will be able to:

  • Write Pythonic code to generate Lists, Sets, and Dictionaries
  • Write Pythonic code that leverages Generator Functions and Generator Expressions
  • Write Pythonic code that leverages Lambdas to map and filter lists
  • Use the terminal to launch and debug Python scripts

You should:

  • Be comfortable with using a browser-based IDE

Lab Environment

This Lab will start with the following AWS resources provisioned automatically for you:

  • A single EC2 instance, named ide.python.platform.instance, which will have a public IP address attached. This instance will host a web-based Python IDE (based on the Visual Code editor).

To achieve the Lab end state, you will be walked through the process of:

  • Using your local browser, access the web-based Python IDE served from the ide.python.platform.instance
  • Completing the following lab exercises:
    • Exercise 1 - List, Set, and Dictionary Comprehensions
    • Exercise 2 - Generators
    • Exercise 3 - Lambdas

 

About the Author

Students7788
Labs21
Courses58
Learning paths12

Jeremy is the DevOps Content Lead at Cloud Academy where he specializes in developing technical training documentation for DevOps.

He has a strong background in software engineering, and has been coding with various languages, frameworks, and systems for the past 20+ years. In recent times, Jeremy has been focused on DevOps, Cloud, Security, and Machine Learning.

Jeremy holds professional certifications for both the AWS and GCP cloud platforms.
 

Covered Topics