[Python] Use a string sequence

Introduction

We are proceeding with Python learning according to Learning Roadmap for Python Beginners on Tommy's blog. This time, refer to [Python] Summary of how to use string sequences. It deals with the concept of sequences and how to use strings.

Target person

--Those who are studying on Tomi-san's blog --For those who want to get an overview of string sequences

environment

Google Colaboratory

content of study

  1. About Python sequences What is a sequence? ** A warehouse (aggregate) that stores variables **

  2. What is a string sequence? x = "string" In the case of, "x is a variable", which means that the character string is stored in x.

  3. Slice ← ** Extract the stored character element **

x = "12345Python"

x [0] Slice the 0th of x 1 ← 0 is on the far left (Python is customary)

x [-11] Slice the 11th from the right 1 ← 11th (that is, 0th) 1 counting from the right

x [0: 3] Slice from 0 to 3 123 ← I got from 0 to 3

x [:] All slices 12345Python ← I brought all the strings

x[0:12:2] '135yhn' ← Slice from 0 to 12 at 2 intervals

The method of acquiring the character string differs depending on the format in [], so use it properly according to the purpose.

reference

[Python] Summary of how to use string sequences

Recommended Posts

[Python] Use a string sequence
Python string
Use pymol as a python library
Use blender as a python module
Create a random string in Python
Python: String concatenation
Python string format
Use print in a Python2 lambda expression
python string slice
# 5 [python3] Extract characters from a character string
[Python] Use string data with scikit-learn SVM
[Python] How to invert a character string
Generate a class from a string in Python
Python2 string type
Use Django from a local Python script
Python string format
Python # string type
Python string inversion
A memorandum of python string deletion process
How to embed a variable in a python string
Python Note: When assigning a value to a string
Create a datetime object from a string in Python (Python 3.3)
Use a custom error page in python / tornado
Decrypt a string encrypted on iOS with Python
Put out a shortened URL string in Python
Insert an object inside a string in Python
String to Unicode Escape Sequence Format for Python
Use thingsspeak from python
A * algorithm (Python edition)
Use config.ini in Python
[Python] Take a screenshot
[Python] Use JSON with Python
Use fluentd from python
Fibonacci sequence using Python
Create a Python module
String manipulation in python
A python lambda expression ...
Use Valgrind in Python
Use MySQL from Python
[Python] Multi-line string assignment
Python string manipulation master
Use mecab with Python3
Use LiquidTap Python Client ③
Use DynamoDB with Python
Use a Property Decorator?
Daemonize a Python process
Use Python 3.8 with Anaconda
[Python2] Date string-> UnixTime-> Date string
[Python] format methodical use
Random string generation (Python)
Use python with docker
Use MySQL from Python
Use LiquidTap Python Client ②
Use BigQuery from python.
Use profiler in Python
Create a Python environment
Python3> documentation string / docstring
Python3> round (a --b, 7)
Python string processing illustration
Use mecab-ipadic-neologd from python
Use LiquidTap Python Client ①