Python tutorials

Python Basics: Conditional Logic and Control Flow

Much of the Python code you’ll write is unconditional. That is, the code does not make any choices. Every line of code is executed in the order that it’s written or in the order that functions are called, with possible repetitions inside loops. In this course, you’ll learn how to use conditional logic to write programs that perform different actions based on different conditions. Paired with functions and loops, conditional logic allows you to write complex programs that can handle […]

Read more

Python Basics: Strings and String Methods

Many programmers, regardless of their specialty, deal with text on a daily basis. For example, web developers work with text input from web forms. Data scientists process text to extract data and perform tasks like sentiment analysis, which can help identify and classify opinions in a body of text. Collections of text in Python are called strings. Special functions called string methods are used to manipulate strings. There are string methods for changing a string from lowercase to uppercase, removing […]

Read more

Build Enumerations of Constants With Python’s Enum

Python’s enum module provides the Enum class, which allows you to create enumeration types. To create your own enumerations, you can either subclass Enum or use its functional API. Both options will let you define a set of related constants as enum members. In the following sections, you’ll learn how to create enumerations in your code using the Enum class. You’ll also learn how to set automatically generated values for your enums and how to create enumerations containing alias and […]

Read more
1 73 74 75 76 77 181