filmov
tv
How to Code PYTHON: String Helper Functions I - Manipulate and Format String Data for Display

Показать описание
Let's get started! 🔥🔥🔥 In this video, we will show you how to write a few PYTHON 🐍 scripts that demonstrate the use of 9 amazing string helper functions that you'll likely use when building real-world Python programs. A helper method is a function that's available to values of a particular data type, and provides additional helpful functionality. In this lesson, you will learn some basics in less than 10 minutes!
In this video, you will learn how to:
★ 0:17 Call capitalize() in the str class by using three different techniques.
★ 1:58 Modify the case of the string from upper to lower, or lower to upper by calling lower(), upper(), title(), and swapcase().
★ 3:55 Count the number of times one string is found in another using count().
★ 4:36 Count how many letters are in a string with len().
★ 5:08 Call startswith() and endswith() to inspect the contents of a string to find out if it starts with or ends with the expected string.
Tips and Tricks:
► Keep in mind that the string input parameter used in count(), startswith(), and endswith() is case-sensitive ("bob" is NOT the same as "BOB").
► Empty space is also counted as a letter with len().
► count() and len() methods return an integer value (e.g. 0, 1, 2...).
► startswith() and endswith() methods return a boolean value (true or false).
WANT MORE PYTHON TUTORIALS?
🐍 Python Coding for Beginners:
For the setup, please read the followings before you begin:
2. Install Python and remember to select "Add Python... to PATH" when asked.
4. Install the Python extension for Visual Studio Code: Go to View and select Extensions, or select the Extensions icon, then search for python.
👇 SUBSCRIBE TO KIDS' 👨🏻💻👩🏻💻 YOUTUBE CHANNEL NOW 👇
#CodingWithKids #PythonProgramming #PythonForBeginners
In this video, you will learn how to:
★ 0:17 Call capitalize() in the str class by using three different techniques.
★ 1:58 Modify the case of the string from upper to lower, or lower to upper by calling lower(), upper(), title(), and swapcase().
★ 3:55 Count the number of times one string is found in another using count().
★ 4:36 Count how many letters are in a string with len().
★ 5:08 Call startswith() and endswith() to inspect the contents of a string to find out if it starts with or ends with the expected string.
Tips and Tricks:
► Keep in mind that the string input parameter used in count(), startswith(), and endswith() is case-sensitive ("bob" is NOT the same as "BOB").
► Empty space is also counted as a letter with len().
► count() and len() methods return an integer value (e.g. 0, 1, 2...).
► startswith() and endswith() methods return a boolean value (true or false).
WANT MORE PYTHON TUTORIALS?
🐍 Python Coding for Beginners:
For the setup, please read the followings before you begin:
2. Install Python and remember to select "Add Python... to PATH" when asked.
4. Install the Python extension for Visual Studio Code: Go to View and select Extensions, or select the Extensions icon, then search for python.
👇 SUBSCRIBE TO KIDS' 👨🏻💻👩🏻💻 YOUTUBE CHANNEL NOW 👇
#CodingWithKids #PythonProgramming #PythonForBeginners
Комментарии