Add Flow Control to your Python application
lessonDuration 5m 37s
Learn how to control the flow of your python application using for, if, while, and range.
Browse
Find courses, lessons, articles, talks, and podcasts.
67 results for "python"
Showing 25–48 · Page 2 of 3
lessonDuration 5m 37s
Learn how to control the flow of your python application using for, if, while, and range.
lessonDuration 52s
Python scripts can be executed by passing the script name to the python command or created as executable commands that can run stand-alone. You’ll learn how to create both in this lesson.
lessonDuration 2m 10s
Python has many methods for searching, joining, and otherwise manipulating strings. Learn which ones are available and how to use them in this lesson.
lessonDuration 2m 1s
Single quotes and double quotes can both be used to declare strings in Python. You can even use triple-double quotes! Learn when to use each in this lesson as well as variable substitution in strings.
lessonDuration 1m 32s
This lesson will introduce arithmetic operations in Python. In addition to basic addition, subtraction, multiplication, and division, you will learn about the differences in division between Python 2 and Python 3.
lessonDuration 56s
If you’ve used other programming languages, you may have learned that an empty object is not the same as an object that does not exist. In this lesson, you’ll learn how to check for None (or Null objects) in Python.
lessonDuration 1m 48s
Python includes an interactive REPL (Read - Evaluate - Print - Loop) console that allows you to easily test and interact with the Python interpreter. You will learn how to use it in this lesson to quickly write and execute code.
lessonDuration 2m 40s
Virtual Environments ensure that dependencies from one Python application don’t overwrite the dependencies of another application. In this lesson, you will learn how to create a virtual environment, switch between virtual environments, and manage dependencies within a virtual environment.
lessonDuration 3m 38s
In this lesson you will learn how to install Python. If you use OS X or Linux, you already have Python 2 installed. I will show you how to install Python 3 on OS X, Linux, and Windows.
lessonDuration 2m 43sFree
The identity operator is used for checking whether the object is of the mentioned type. Example: ``` >> a = "Hello World!" >> type(a) is str >> True ``` The result returned in the above case is true because the type of object is str. Identity operator is also used to compare the object with None. Example: ``` >> a = None >> a is None >> print(a) >> True ``` Internally, the identity operator compares the memory address of the objects. Built-in `id()` method returns a unique number i.e address of the object in memory. If the address of both the objects in memory is the same identity operator returns the result as True. Example: ``` >> a = 10 >> b = 10 >> a is b >> True >> id(a) >> 916744 >> id(b) >> 916744 ``` The above code snippet tells us that value of both the objects is the same and variables `a` and `b` are referring to the same object in memory.
lessonDuration 2m 6sFree
Use the equality operator to compare the values of the objects. Identity operator is used to verifying that objects are equal but are not referring to the same object in memory. Use cases where identity operator is used are: - to test if the object is None - to test if the object is of a particular type or not There may be use cases where the output returned by both the operators is the same. But, in your program, you have used the identity operator instead of the equality operator. To avoid such mistakes it is important to understand the difference between identity and equality operator.
lessonDuration 1m 41sFree
While solving real-life use cases through programming and also while testing your code you will come across scenarios where you have to compare the value of different objects. And, then to solve the problem you can use the equality operator.
lessonDuration 35sFree
Learn to create a one item tuple. When creating a one item tuple, a comma has to be included after the item. Otherwise, your tuple will not return tuple as its data type.
lessonDuration 1m 19sFree
Tuples are immutable so there is no way to add or replace items in tuples. There is a way to get around this by adding two tuples into one.
lessonDuration 1m 10sFree
Sometimes you get strings instead of objects and you have to parse them out. Here's an example where the raw data I got from a Twitch chatbot message wasn't useful to me until I parsed it into a dictionary.
lessonDuration 5m 5sFree
In this lesson, you will learn: How to install Flask Use Flask to create a minimal website Build routes in Flask to respond to website endpoints Use Variable Rules to pass parts of the URL to your functions as keyword parameters
lessonDuration 5m 36s
Functions allow you to encapsulate your code into a reusable component. Learn how to create functions, add arguments to your functions, assign default values to arguments, and use keyword arguments.
lessonDuration 5m 16s
Exceptions cause your application to crash. Handling them allows you to recover gracefully and keep your application running. Learn how to handle exceptions, find what exceptions you should be handling, and exit gracefully in this lesson. You will also learn how you should *not* handle exceptions and when it is better to let your application crash rather than swallowing an exception.
lessonDuration 7m 36s
Object oriented classes work much like classes in other languages. Learn how to create them and use them, learn the difference between class variables and instance variables, creating class methods, and learn how to create classes that inherit from other classes.
lessonDuration 4m 52s
Why should you have to write all the code? Why can’t you leverage code written by others? I’ve got great news: you can. You’ll learn how to search pip, Python’s package installer, to find and install packages to add new features and functionality to your application.
lessonDuration 7m 51s
Print statements will get you a long way in monitoring the behavior of your application, but logging will get your further. Learn how to implement logging in this lesson to generate INFO, WARNING, ERROR, and DEBUG logs for your application.
lessonDuration 1m 52s
Dictionaries may be familiar to you as hash maps. In this lesson, you will learn how to create them, get the values, and delete elements from the dictionary.
lessonDuration 3m 50s
List comprehensions provide a concise way to create new lists, where each item is the result of an operation applied to each member of an existing list, dictionary or other iterable. Learn how to create your own list comprehensions in this lesson.
lessonDuration 1m 18s
In this lesson, you will learn what mutable and immutable objects are, and the difference between them. This understanding will help you determine when objects can be modified in place, and when new objects must be created.